Skip to content

Commit fd8667a

Browse files
committed
Address duplicated test job across two workflow files
#4 (comment)
1 parent f0c4b21 commit fd8667a

3 files changed

Lines changed: 29 additions & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,4 @@ on:
66

77
jobs:
88
test:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v4
13-
14-
- name: Setup Node
15-
uses: actions/setup-node@v4
16-
with:
17-
node-version: "20"
18-
cache: "npm"
19-
20-
- name: Install dependencies
21-
run: npm ci
22-
23-
- name: Install Playwright Browsers
24-
run: npx playwright install --with-deps chromium
25-
26-
- name: Run tests
27-
run: npm test
9+
uses: ./.github/workflows/test.yml

.github/workflows/deploy.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,7 @@ concurrency:
1717

1818
jobs:
1919
test:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v4
24-
25-
- name: Setup Node
26-
uses: actions/setup-node@v4
27-
with:
28-
node-version: "20"
29-
cache: "npm"
30-
31-
- name: Install dependencies
32-
run: npm ci
33-
34-
- name: Install Playwright Browsers
35-
run: npx playwright install --with-deps chromium
36-
37-
- name: Run tests
38-
run: npm test
20+
uses: ./.github/workflows/test.yml
3921

4022
build:
4123
needs: test
@@ -71,7 +53,7 @@ jobs:
7153
- name: Setup Node
7254
uses: actions/setup-node@v4
7355
with:
74-
node-version: "20"
56+
node-version-file: ".nvmrc"
7557
cache: ${{ steps.detect-package-manager.outputs.manager }}
7658

7759
- name: Setup Pages

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Setup Node
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version-file: ".nvmrc"
17+
cache: "npm"
18+
19+
- name: Install dependencies
20+
run: npm ci
21+
22+
- name: Install Playwright Browsers
23+
run: npx playwright install --with-deps chromium
24+
25+
- name: Run tests
26+
run: npm test

0 commit comments

Comments
 (0)