workflow troubles #30
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
on: | |
push: | |
branches: | |
- main | |
- master | |
workflow_dispatch: | |
jobs: | |
playwrighttests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x.x | |
- name: Install Angular program dependencies, Angular global CLI + ng build | |
run: cd frontend && npm i -g @angular/cli && npm i && ng build -c="development" | |
- name: Build test code and install playwright test browser | |
run: cd PlaywrightTests && dotnet build && pwsh bin/Debug/net8.0/playwright.ps1 install --with-deps | |
- name: Build and run Web API + getting process ID for shutting down later | |
run: cd api && dotnet run & echo "API_PID=$!" >> $GITHUB_ENV | |
env: | |
myDb1: ${{ secrets.MYDB2 }} | |
- name: Build and run Frontend Angular + getting process ID for shutting down later | |
run: cd frontend && ng serve --open & echo "API_PID=$!" >> $GITHUB_ENV | |
env: | |
myDb1: ${{ secrets.MYDB2 }} | |
- name: Run tests once API is running (sleep interval set to 60 seconds) | |
run: cd PlaywrightTests && sleep 60 && dotnet test | |
env: | |
myDb1: ${{ secrets.MYDB2 }} | |
- name: Shutdown Web API once the tests are done running | |
run: kill $API_PID | |