Files
CookieMonster/.github/workflows/CI.yml
2021-05-01 22:44:32 +02:00

30 lines
1.1 KiB
YAML

name: CI
on: push
jobs:
Check_linting_test_and_build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npx eslint src
- name: Run Mocha tests
run: npx mocha
- name: Check if CookieMonster.js is built correctly
run: |
npx webpack -o ./tmp --env production
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
echo '### SUCCESS: CookieMonster is correctly built! ###'
else
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
exit 1
fi
if cmp <(head -n 2 CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
echo '### SUCCESS: CookieMonster is correctly built! ###'
else
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
exit 1
fi