End to end testing with Playwright. #4
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: "9.6.7" | |
| - name: Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cabal/store | |
| dist-newstyle | |
| key: ${{ runner.os }}-cabal-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.hs') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cabal-${{ hashFiles('**/*.cabal') }}- | |
| ${{ runner.os }}-cabal- | |
| - name: Install dependencies | |
| run: cabal update && cabal build --only-dependencies | |
| - name: Build | |
| run: cabal build | |
| - name: Run tests | |
| run: cabal test | |
| e2e: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: "9.6.7" | |
| - name: Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cabal/store | |
| dist-newstyle | |
| key: ${{ runner.os }}-cabal-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.hs') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cabal-${{ hashFiles('**/*.cabal') }}- | |
| ${{ runner.os }}-cabal- | |
| - name: Build e2e-server | |
| run: cabal update && cabal build e2e-server | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install Playwright | |
| working-directory: e2e | |
| run: npm ci && npx playwright install --with-deps chromium | |
| - name: Run e2e tests | |
| working-directory: e2e | |
| run: npx playwright test | |
| - name: Upload Playwright report | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: e2e/playwright-report/ |