demo apps workflow 4 #4
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: Build and test the demo apps | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 0 * * 0' # Once a week: "At 00:00 on Sunday." | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
main: | |
name: Build and test the demo apps | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump github context for debug purposes | |
env: | |
GITHUB_CONTEXT: ${{ toJSON(github) }} | |
run: $env:GITHUB_CONTEXT | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: accessibility-axe demo | |
run: | | |
cd "${{ github.workspace }}/demos/accessibility-axe" | |
npm ci | |
npx playwright install --with-deps | |
npm test | Tee-Object -Variable testOutput | |
$expectedFailures = $false | |
foreach($outputLine in $testOutput) | |
{ | |
if($outputLine.Contains("3 failed")) | |
{ | |
$expectedFailures = $true | |
} | |
} | |
if($expectedFailures) | |
{ | |
Write-Output "::error::Failed running the `accessibility-axe` tests. Expected exactly 3 failed tests. See the accessibility-axe demo step for more details." | |
Exit 0 | |
} | |
- name: code-coverage-with-monocart-reporter demo | |
run: | | |
cd "${{ github.workspace }}/demos/code-coverage-with-monocart-reporter" | |
npm ci | |
npx playwright install --with-deps | |
npm test |