1
1
mirror of https://github.com/primer/css.git synced 2024-11-30 11:17:05 +03:00
css/.github/workflows/ci.yml
2021-12-06 09:19:11 -08:00

63 lines
1.5 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
stylelint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- run: yarn
- run: yarn dist
- name: Lint source files
run: yarn stylelint --fix
- name: Look for unused stylelint:disable lines
run: yarn stylelint -- --report-needless-disables
- name: Push up any fixes
if: ${{ github.event_name == 'pull_request' }}
run: |
set +e
git status | grep modified
if [ $? -eq 0 ]
then
set -e
git remote update
git fetch
git checkout --track origin/$GITHUB_HEAD_REF
git config --local user.email "actions@github.com"
git config --local user.name "Actions Auto Build"
git add src
git commit -m "Stylelint auto-fixes"
git push
else
set -e
echo "No changes since last run"
fi
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- run: yarn
- name: Lint workflow files
run: yarn eslint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- run: yarn
- name: Jest
run: yarn test