Applied test name and formatting suggestions from code review #252
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@v4 | |
- 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@v4 | |
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 | |
- name: Setup .NET Core - for coverage report # Required to execute ReportGenerator | |
uses: actions/setup-dotnet@v4 | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
dotnet-version: 8.x | |
dotnet-quality: 'ga' | |
- name: Create coverage md report | |
uses: danielpalme/[email protected] | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
reports: ./platform/reports/coverage-report.xml | |
targetdir: ./platform/reports/ | |
reporttypes: MarkdownSummaryGithub | |
- name: Output coverage to summary | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
run: cat ./platform/reports/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
build-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install node dependencies | |
run: | | |
npm ci | |
npm install -g karma-cli | |
- name: Setup safari driver | |
run: | | |
sudo safaridriver --enable | |
- 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 -- --browsers SafariNative | |
- name: Create test report | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
name: Unit Test Results - mac | |
path: platform/reports/TESTS*.xml | |
reporter: java-junit | |
fail-on-error: true | |
- name: Setup .NET Core - for coverage report # Required to execute ReportGenerator | |
uses: actions/setup-dotnet@v4 | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
dotnet-version: 8.x | |
dotnet-quality: 'ga' | |
- name: Create coverage md report | |
uses: danielpalme/[email protected] | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
reports: ./platform/reports/coverage-report.xml | |
targetdir: ./platform/reports/ | |
reporttypes: MarkdownSummaryGithub | |
- name: Output coverage to summary | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
run: cat ./platform/reports/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
build-win: | |
runs-on: windows-latest | |
env: | |
EDGE_BIN: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install node dependencies | |
run: | | |
npm ci | |
npm install -g karma-cli | |
- name: Setup edge driver | |
run: | | |
choco install selenium-chromium-edge-driver | |
- 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 -- --browsers EdgeHeadless | |
- name: Create test report | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
name: Unit Test Results - win | |
path: platform/reports/TESTS*.xml | |
reporter: java-junit | |
fail-on-error: true | |
- name: Setup .NET Core - for coverage report # Required to execute ReportGenerator | |
uses: actions/setup-dotnet@v4 | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
dotnet-version: 8.x | |
dotnet-quality: 'ga' | |
- name: Create coverage md report | |
uses: danielpalme/[email protected] | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
with: | |
reports: ./platform/reports/coverage-report.xml | |
targetdir: ./platform/reports/ | |
reporttypes: MarkdownSummaryGithub | |
- name: Output coverage to summary | |
if: success() || failure() && steps.run-unit-tests.outcome == 'success' | |
run: Get-Content -Path ".\platform\reports\SummaryGithub.md" >> $Env:GITHUB_STEP_SUMMARY |