From 17c83ab62a132fcd1d2e602851723f9d11f2cb8a Mon Sep 17 00:00:00 2001 From: Henric Trotzig Date: Wed, 18 Dec 2024 12:05:31 +0100 Subject: [PATCH] Run Playwright tests in CI So that we have some test coverage in this repo. --- .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f2c1818 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Run tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Start dev server in the background + run: yarn dev & + + - name: Install Playwright browsers + run: npx playwright install chromium + + - name: Run tests + run: yarn test + env: + HAPPO_API_KEY: ${{ secrets.HAPPO_API_KEY }} + HAPPO_API_SECRET: ${{ secrets.HAPPO_API_SECRET }}