Skip to content

Commit 4cdb698

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

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

.github/workflows/release.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on:
4+
workflow_run:
5+
workflows: Run tests
6+
branches: master
7+
types:
8+
- completed
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
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

+3-29
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
name: CI
2-
1+
name: Run tests
32
on: push
4-
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)