Skip to content

Commit 6be63e0

Browse files
committed
workflow: new release workflow
1 parent e333312 commit 6be63e0

File tree

3 files changed

+115
-132
lines changed

3 files changed

+115
-132
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -8,136 +8,7 @@ on:
88
- main
99
- minor
1010

11-
permissions:
12-
contents: read # to fetch code (actions/checkout)
13-
1411
jobs:
15-
unit-test:
16-
runs-on: ubuntu-latest
17-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
18-
env:
19-
PUPPETEER_SKIP_DOWNLOAD: 'true'
20-
steps:
21-
- uses: actions/checkout@v4
22-
23-
- name: Install pnpm
24-
uses: pnpm/action-setup@v4.0.0
25-
26-
- name: Install Node.js
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version-file: '.node-version'
30-
cache: 'pnpm'
31-
32-
- run: pnpm install
33-
34-
- name: Run unit tests
35-
run: pnpm run test-unit
36-
37-
unit-test-windows:
38-
runs-on: windows-latest
39-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
40-
env:
41-
PUPPETEER_SKIP_DOWNLOAD: 'true'
42-
steps:
43-
- uses: actions/checkout@v4
44-
45-
- name: Install pnpm
46-
uses: pnpm/action-setup@v4.0.0
47-
48-
- name: Install Node.js
49-
uses: actions/setup-node@v4
50-
with:
51-
node-version-file: '.node-version'
52-
cache: 'pnpm'
53-
54-
- run: pnpm install
55-
56-
- name: Run compiler unit tests
57-
run: pnpm run test-unit compiler
58-
59-
- name: Run ssr unit tests
60-
run: pnpm run test-unit server-renderer
61-
62-
e2e-test:
63-
runs-on: ubuntu-latest
64-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
65-
steps:
66-
- uses: actions/checkout@v4
67-
68-
- name: Setup cache for Chromium binary
69-
uses: actions/cache@v4
70-
with:
71-
path: ~/.cache/puppeteer
72-
key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
73-
74-
- name: Install pnpm
75-
uses: pnpm/action-setup@v4.0.0
76-
77-
- name: Install Node.js
78-
uses: actions/setup-node@v4
79-
with:
80-
node-version-file: '.node-version'
81-
cache: 'pnpm'
82-
83-
- run: pnpm install
84-
- run: node node_modules/puppeteer/install.mjs
85-
86-
- name: Run e2e tests
87-
run: pnpm run test-e2e
88-
89-
- name: verify treeshaking
90-
run: node scripts/verify-treeshaking.js
91-
92-
lint-and-test-dts:
93-
runs-on: ubuntu-latest
94-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
95-
env:
96-
PUPPETEER_SKIP_DOWNLOAD: 'true'
97-
steps:
98-
- uses: actions/checkout@v4
99-
100-
- name: Install pnpm
101-
uses: pnpm/action-setup@v4.0.0
102-
103-
- name: Install Node.js
104-
uses: actions/setup-node@v4
105-
with:
106-
node-version-file: '.node-version'
107-
cache: 'pnpm'
108-
109-
- run: pnpm install
110-
111-
- name: Run eslint
112-
run: pnpm run lint
113-
114-
- name: Run prettier
115-
run: pnpm run format-check
116-
117-
- name: Run type declaration tests
118-
run: pnpm run test-dts
119-
120-
# benchmarks:
121-
# runs-on: ubuntu-latest
122-
# if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
123-
# env:
124-
# PUPPETEER_SKIP_DOWNLOAD: 'true'
125-
# steps:
126-
# - uses: actions/checkout@v4
127-
128-
# - name: Install pnpm
129-
# uses: pnpm/action-setup@v3.0.0
130-
131-
# - name: Install Node.js
132-
# uses: actions/setup-node@v4
133-
# with:
134-
# node-version-file: '.node-version'
135-
# cache: 'pnpm'
136-
137-
# - run: pnpm install
138-
139-
# - name: Run benchmarks
140-
# uses: CodSpeedHQ/action@v2
141-
# with:
142-
# run: pnpm vitest bench --run
143-
# token: ${{ secrets.CODSPEED_TOKEN }}
12+
test:
13+
if: ${{ ! startsWith(github.event.head_commit.message, 'release:') && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) }}
14+
uses: ./.github/workflows/test.yml

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ on:
66
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
77

88
jobs:
9+
test:
10+
uses: ./.github/workflows/test.yml
11+
912
release:
1013
# prevents this action from running on forks
1114
if: github.repository == 'vuejs/core'
15+
needs: [test]
1216
runs-on: ubuntu-latest
1317
permissions:
1418
contents: write

.github/workflows/test.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: 'test'
2+
3+
on: workflow_call
4+
5+
permissions:
6+
contents: read # to fetch code (actions/checkout)
7+
8+
jobs:
9+
unit-test:
10+
runs-on: ubuntu-latest
11+
env:
12+
PUPPETEER_SKIP_DOWNLOAD: 'true'
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v4.0.0
18+
19+
- name: Install Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version-file: '.node-version'
23+
cache: 'pnpm'
24+
25+
- run: pnpm install
26+
27+
- name: Run unit tests
28+
run: pnpm run test-unit
29+
30+
unit-test-windows:
31+
runs-on: windows-latest
32+
env:
33+
PUPPETEER_SKIP_DOWNLOAD: 'true'
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Install pnpm
38+
uses: pnpm/action-setup@v4.0.0
39+
40+
- name: Install Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version-file: '.node-version'
44+
cache: 'pnpm'
45+
46+
- run: pnpm install
47+
48+
- name: Run compiler unit tests
49+
run: pnpm run test-unit compiler
50+
51+
- name: Run ssr unit tests
52+
run: pnpm run test-unit server-renderer
53+
54+
e2e-test:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Setup cache for Chromium binary
60+
uses: actions/cache@v4
61+
with:
62+
path: ~/.cache/puppeteer
63+
key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
64+
65+
- name: Install pnpm
66+
uses: pnpm/action-setup@v4.0.0
67+
68+
- name: Install Node.js
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version-file: '.node-version'
72+
cache: 'pnpm'
73+
74+
- run: pnpm install
75+
- run: node node_modules/puppeteer/install.mjs
76+
77+
- name: Run e2e tests
78+
run: pnpm run test-e2e
79+
80+
- name: verify treeshaking
81+
run: node scripts/verify-treeshaking.js
82+
83+
lint-and-test-dts:
84+
runs-on: ubuntu-latest
85+
env:
86+
PUPPETEER_SKIP_DOWNLOAD: 'true'
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- name: Install pnpm
91+
uses: pnpm/action-setup@v4.0.0
92+
93+
- name: Install Node.js
94+
uses: actions/setup-node@v4
95+
with:
96+
node-version-file: '.node-version'
97+
cache: 'pnpm'
98+
99+
- run: pnpm install
100+
101+
- name: Run eslint
102+
run: pnpm run lint
103+
104+
- name: Run prettier
105+
run: pnpm run format-check
106+
107+
- name: Run type declaration tests
108+
run: pnpm run test-dts

0 commit comments

Comments
 (0)