Use end to end tests #22
Workflow file for this run
This file contains hidden or 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: | |
| pull_request: | |
| jobs: | |
| run-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Set timestamp variable | |
| id: timestamp | |
| run: echo "datetime=$(date +'%Y-%m-%d_%H-%M-%S')" >> $GITHUB_OUTPUT | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.101' | |
| - name: Install wasm-tools | |
| run: dotnet workload install wasm-tools | |
| - name: Restore & Build | |
| run: dotnet build | |
| - name: Install Playwright Browsers | |
| run: | | |
| dotnet tool restore | |
| dotnet playwright install --with-deps | |
| - name: Start App | |
| run: ASPNETCORE_ENVIRONMENT=Development dotnet run --project AudioCuesheetEditor & | |
| - name: Wait for app to be ready | |
| run: | | |
| for i in {1..30}; do | |
| curl -sSf http://localhost:5132/ && echo "App is up!" && exit 0 | |
| echo "Waiting for app..." | |
| sleep 2 | |
| done | |
| echo "App failed to start" && exit 1 | |
| - name: Run tests | |
| run: dotnet test | |
| - name: Upload traces | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-traces-${{ steps.timestamp.outputs.datetime }} | |
| path: AudioCuesheetEditor.End2EndTests/bin/Debug/net9.0/playwright-traces/ | |
| if-no-files-found: ignore |