Skip to content

Commit 7deeac7

Browse files
committed
ci: run tests before deploy
1 parent 03e819a commit 7deeac7

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy Next.js site to Pages
33
on:
44
# Runs on pushes targeting the default branch
55
push:
6-
branches: ['main']
6+
branches: ["main"]
77

88
# Allows you to run this workflow manually from the Actions tab
99
workflow_dispatch:
@@ -17,10 +17,16 @@ permissions:
1717
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1818
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
1919
concurrency:
20-
group: 'pages'
20+
group: "pages"
2121
cancel-in-progress: false
2222

2323
jobs:
24+
run-tests:
25+
uses: ./.github/workflows/test.yml
26+
27+
run-playwright:
28+
uses: ./.github/workflows/playwright.yml
29+
2430
# Build job
2531
build:
2632
runs-on: ubuntu-latest
@@ -47,7 +53,7 @@ jobs:
4753
- name: Setup Node
4854
uses: actions/setup-node@v4
4955
with:
50-
node-version: '20'
56+
node-version: "20"
5157
cache: ${{ steps.detect-package-manager.outputs.manager }}
5258
- name: Setup Pages
5359
uses: actions/configure-pages@v5

.github/workflows/playwright.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Playwright Tests
2+
23
on:
3-
push:
4-
branches: [main]
54
pull_request:
6-
branches: [main]
5+
workflow_call:
6+
77
jobs:
88
test:
99
timeout-minutes: 20

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
name: 'Test Lint and Build'
1+
name: "Test Lint and Build"
22

33
on:
44
pull_request:
5+
workflow_call:
56

67
jobs:
78
test:
@@ -12,8 +13,8 @@ jobs:
1213
- name: Setup Node.js
1314
uses: actions/setup-node@v4
1415
with:
15-
node-version: '22'
16-
cache: 'yarn'
16+
node-version: "22"
17+
cache: "yarn"
1718
- name: Install dependencies
1819
run: yarn install
1920
- name: Run linting

0 commit comments

Comments
 (0)