Skip to content

Commit 7537623

Browse files
committed
ci: extract test workflow
1 parent 765da02 commit 7537623

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

.github/workflows/release.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on: push
4+
5+
jobs:
6+
test:
7+
uses: ./.github/workflows/test.yml
8+
release:
9+
runs-on: ubuntu-latest
10+
needs:
11+
- test
12+
if: github.ref == 'refs/heads/master'
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: npm install
16+
run: npm install
17+
- name: Build
18+
run: npm run build
19+
- name: Release
20+
uses: cycjimmy/semantic-release-action@v3
21+
with:
22+
extra_plugins: |
23+
@semantic-release/changelog
24+
@semantic-release/git
25+
branch: master
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/ci.yml .github/workflows/test.yml

+4-30
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
name: CI
2-
3-
on: push
4-
1+
name: Run tests
2+
on: workflow_call
53
jobs:
64
unit-test:
75
runs-on: ubuntu-latest
@@ -16,7 +14,7 @@ jobs:
1614
run: npm ci
1715
- name: Unit tests
1816
run: npm run test:unit
19-
17+
2018
integration-test:
2119
runs-on: ubuntu-latest
2220
name: Integration Tests
@@ -55,28 +53,4 @@ jobs:
5553
- name: build
5654
run: npm run build
5755
- name: run tests
58-
run: npm run test:e2e
59-
60-
release:
61-
runs-on: ubuntu-latest
62-
needs:
63-
- unit-test
64-
- integration-test
65-
- e2e-test
66-
if: github.ref == 'refs/heads/master'
67-
steps:
68-
- uses: actions/checkout@v4
69-
- name: npm install
70-
run: npm install
71-
- name: Build
72-
run: npm run build
73-
- name: Release
74-
uses: cycjimmy/semantic-release-action@v3
75-
with:
76-
extra_plugins: |
77-
@semantic-release/changelog
78-
@semantic-release/git
79-
branch: master
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
56+
run: npm run test:e2e

0 commit comments

Comments
 (0)