build: remove unused dependency on wait-on #99
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: [push] | |
jobs: | |
all-tests: | |
runs-on: ubuntu-latest | |
# Stop the occasional rogue instance before the 6h GitHub limit | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install everything | |
run: npm install | |
- name: Check1 Run spec tests | |
id: specs | |
continue-on-error: true | |
run: npm run-script ci:test | |
- name: Upload coverage reports to Codecov | |
if: steps.specs.outcome == 'success' | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Check2 Run ng lint | |
id: lint | |
continue-on-error: true | |
run: npm run-script lint | |
- name: Check3 Validate data | |
id: validate | |
continue-on-error: true | |
run: | | |
npm run-script generate-schemas | |
npm run-script validate | |
- name: Check4 Check compressed data files | |
if: steps.validate.outcome == 'success' | |
id: compress | |
continue-on-error: true | |
run: | | |
npm run-script compress fr v1 | |
ALL_OK=1; \ | |
for file in $(git status --porcelain=v1 | grep '\.json\.gz' | cut -c4-); do \ | |
if ! diff -q <(git show HEAD:$file 2> /dev/null | gunzip -f) <(zcat $file); then \ | |
echo Error: "$file needs to be (re-)compressed and committed."; \ | |
ALL_OK=0; \ | |
fi; \ | |
done; \ | |
if [[ $ALL_OK == 0 ]]; then \ | |
echo Error: Please run \"npm run-script compress fr v1\" and commit the .json.gz files created or updated.; \ | |
false; \ | |
else \ | |
echo OK; \ | |
fi | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Check5 Run Playwright tests | |
id: e2e | |
continue-on-error: true | |
run: npx npm run-script e2e | |
- uses: actions/upload-artifact@v3 | |
if: steps.e2e.outcome == 'success' | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- name: Fail if any Check step failed | |
if: steps.specs.outcome == 'failure' || steps.lint.outcome == 'failure' || steps.validate.outcome == 'failure' || steps.compress.outcome == 'failure' || steps.e2e.outcome == 'failure' | |
run: | | |
if [[ "${{ steps.specs.outcome }}" == failure ]]; then echo ERROR: Check1 Run spec tests failed; fi | |
if [[ "${{ steps.lint.outcome }}" == failure ]]; then echo ERROR: Check2 Run ng lint failed; fi | |
if [[ "${{ steps.validate.outcome }}" == failure ]]; then echo ERROR: Check3 Validate data failed; fi | |
if [[ "${{ steps.compress.outcome }}" == failure ]]; then echo ERROR: Check4 Check compressed data files failed; fi | |
if [[ "${{ steps.e2e.outcome }}" == failure ]]; then echo ERROR: Check5 Run Playwright tests failed; fi | |
false |