Update to CI and incorporate tests
This commit is contained in:
26
.github/workflows/CI.yml
vendored
26
.github/workflows/CI.yml
vendored
@@ -1,31 +1,29 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on: pull_request
|
on: pull_request
|
||||||
jobs:
|
jobs:
|
||||||
Check_ESLint:
|
Check_linting_test_and_build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
- name: Run ESLint
|
- name: Run ESLint
|
||||||
run: |
|
run: npx eslint src
|
||||||
npm install
|
- name: Run Mocha tests
|
||||||
npx eslint src
|
run: npx mocha
|
||||||
Check_main_file:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Check if CookieMonster.js is built correctly
|
- name: Check if CookieMonster.js is built correctly
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npx webpack -o ./tmp --env production
|
||||||
npx webpack -o ./test --env production
|
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
|
||||||
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 test/CookieMonster.js); then
|
|
||||||
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
||||||
else
|
else
|
||||||
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
|
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if cmp <(head -n 2 CookieMonster.js) <(head -n 2 test/CookieMonster.js); then
|
if cmp <(head -n 2 CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
|
||||||
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
echo '### SUCCESS: CookieMonster is correctly built! ###'
|
||||||
else
|
else
|
||||||
echo '### WARNING: Make sure to move the file from the /dist folder to the main folder. Otherwise Github Pages won't notice it ###'
|
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user