run-unit-tests #192
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-unit-tests | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Chrome | |
run: | | |
sudo apt-get update | |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo apt install ./google-chrome-stable_current_amd64.deb | |
- name: Setup node 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install node dependencies | |
run: | | |
npm ci | |
npm install -g karma-cli | |
- name: Code linting | |
run: npm run lint --workspaces | |
- name: Create lint report | |
if: success() || failure() | |
uses: dorny/test-reporter@v1 | |
with: | |
name: Lint Results | |
path: "\ | |
platform/reports/lint-results.xml,\ | |
tokenserver/reports/lint-results.xml" | |
reporter: java-junit | |
fail-on-error: true | |
- name: Build the education platform | |
id: build-platform | |
if: success() || failure() | |
run: npm run build --workspaces | |
- name: Run the unit tests | |
id: run-unit-tests | |
if: success() || failure() && steps.build-platform.outcome == 'success' | |
run: npm test --workspaces | |
- name: Create test report | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
name: Unit Test Results | |
path: platform/reports/TESTS*.xml | |
reporter: java-junit | |
fail-on-error: true |