Skip to content

Commit d7b407c

Browse files
committed
chore: workflow
1 parent bd37a13 commit d7b407c

File tree

3 files changed

+138
-72
lines changed

3 files changed

+138
-72
lines changed

.github/workflows/check.yaml

Lines changed: 137 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,96 @@ on:
1010

1111
env:
1212
LATEST_NODE_VERSION: 22
13-
LINUX_VERSION: ubuntu-latest
14-
WINDOWS_VERSION: windows-2025
13+
APIFY_CLI_DISABLE_TELEMETRY: 1
1514

1615
concurrency:
1716
cancel-in-progress: false
1817
group: checks-${{ github.event_name }}
1918

2019
jobs:
21-
build_and_test:
22-
name: Build & Test
20+
build:
2321
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
24-
runs-on: ${{ matrix.os }}
22+
23+
name: Build
24+
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Use Node.js ${{ env.LATEST_NODE_VERSION }}
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ env.LATEST_NODE_VERSION }}
34+
35+
- name: Enable corepack
36+
run: |
37+
corepack enable
38+
corepack prepare yarn@stable --activate
39+
40+
- name: Activate cache for Node.js ${{ env.LATEST_NODE_VERSION }}
41+
uses: actions/setup-node@v4
42+
with:
43+
cache: yarn
44+
45+
- name: Install Dependencies
46+
run: yarn
47+
48+
- name: Run TSC
49+
run: yarn build
50+
51+
- name: Ensure the reference documentation builds
52+
run: yarn update-docs
53+
54+
lint:
55+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
56+
57+
name: Lint & Format
58+
59+
runs-on: ubuntu-latest
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Use Node.js ${{ env.LATEST_NODE_VERSION }}
65+
uses: actions/setup-node@v4
66+
with:
67+
node-version: ${{ env.LATEST_NODE_VERSION }}
68+
69+
- name: Enable corepack
70+
run: |
71+
corepack enable
72+
corepack prepare yarn@stable --activate
73+
74+
- name: Activate cache for Node.js ${{ env.LATEST_NODE_VERSION }}
75+
uses: actions/setup-node@v4
76+
with:
77+
cache: yarn
78+
79+
- name: Install Dependencies
80+
run: yarn
81+
82+
- name: Run lint checks
83+
run: yarn lint
84+
85+
- name: Run format checks
86+
run: yarn format
87+
88+
test_local:
89+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
90+
91+
name: Local Tests
92+
93+
needs: [build]
2594

2695
strategy:
2796
fail-fast: false
2897
matrix:
2998
os: [ubuntu-latest, windows-2025]
3099
node-version: [18, 20, 22, 24]
31100

101+
runs-on: ${{ matrix.os }}
102+
32103
steps:
33104
- name: Mask secrets
34105
run: |
@@ -54,24 +125,17 @@ jobs:
54125
- name: Install Dependencies
55126
run: yarn
56127

57-
- name: Run Tests
58-
env:
59-
TEST_USER_TOKEN: ${{ secrets.APIFY_TEST_USER_API_TOKEN }}
60-
APIFY_CLI_DISABLE_TELEMETRY: 1
61-
run: yarn test
128+
- name: Run local tests
129+
run: yarn test:local
62130

63-
# - name: Ensure the reference documentation builds
64-
# run: yarn update-docs
131+
test_api:
132+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
65133

66-
test_python_support:
67-
name: Test Python template support
68-
strategy:
69-
fail-fast: false
70-
matrix:
71-
os: [ubuntu-latest, windows-2025]
72-
python-version: ["3.9", "3.10", "3.11", "3.12"]
134+
name: API Tests
73135

74-
runs-on: ${{ matrix.os }}
136+
needs: [build]
137+
138+
runs-on: ubuntu-latest
75139

76140
steps:
77141
- name: Mask secrets
@@ -80,101 +144,115 @@ jobs:
80144
81145
- uses: actions/checkout@v4
82146

83-
- name: Use Node.js 22
147+
- name: Use Node.js ${{ env.LATEST_NODE_VERSION }}
84148
uses: actions/setup-node@v4
85149
with:
86-
node-version: 22
150+
node-version: ${{ env.LATEST_NODE_VERSION }}
87151

88152
- name: Enable corepack
89153
run: |
90154
corepack enable
91155
corepack prepare yarn@stable --activate
92156
93-
- name: Activate cache for Node.js 22
157+
- name: Activate cache for Node.js ${{ env.LATEST_NODE_VERSION }}
94158
uses: actions/setup-node@v4
95159
with:
96160
cache: yarn
97161

98162
- name: Install Dependencies
99163
run: yarn
100164

101-
- name: Set up Python ${{ matrix.python-version }}
102-
uses: actions/setup-python@v5
103-
with:
104-
python-version: ${{ matrix.python-version }}
105-
106-
- name: Run Python tests
165+
- name: Run API tests
107166
env:
108167
TEST_USER_TOKEN: ${{ secrets.APIFY_TEST_USER_API_TOKEN }}
109-
APIFY_CLI_DISABLE_TELEMETRY: 1
110-
run: yarn test-python
168+
run: yarn test:api
111169

112-
docs:
113-
name: Docs build
170+
test_python_support:
114171
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
115-
runs-on: ubuntu-latest
172+
173+
name: Python Support
174+
175+
strategy:
176+
fail-fast: false
177+
matrix:
178+
os: [ubuntu-latest, windows-2025]
179+
python-version: ["3.9", "3.10", "3.11", "3.12"]
180+
181+
runs-on: ${{ matrix.os }}
182+
116183
steps:
117-
- name: Checkout Source code
118-
uses: actions/checkout@v4
184+
- name: Mask secrets
185+
run: |
186+
echo "::add-mask::${{ secrets.APIFY_TEST_USER_API_TOKEN }}"
187+
188+
- uses: actions/checkout@v4
119189

120-
- name: Use Node.js 22
190+
- name: Use Node.js ${{ env.LATEST_NODE_VERSION }}
121191
uses: actions/setup-node@v4
122192
with:
123-
node-version: 22
193+
node-version: ${{ env.LATEST_NODE_VERSION }}
124194

125195
- name: Enable corepack
126196
run: |
127197
corepack enable
128198
corepack prepare yarn@stable --activate
129199
130-
- name: Activate cache for Node.js 22
200+
- name: Activate cache for Node.js ${{ env.LATEST_NODE_VERSION }}
131201
uses: actions/setup-node@v4
132202
with:
133203
cache: yarn
134204

135205
- name: Install Dependencies
136206
run: yarn
137207

138-
- name: Build & deploy docs
139-
run: |
140-
cd website
141-
yarn
142-
yarn build
208+
- name: Set up Python ${{ matrix.python-version }}
209+
uses: actions/setup-python@v5
210+
with:
211+
python-version: ${{ matrix.python-version }}
212+
213+
- name: Run Python tests
214+
run: yarn test-python
215+
216+
docs:
217+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
218+
219+
name: Docs build
143220

144-
lint:
145-
name: Lint
146221
runs-on: ubuntu-latest
147222

148223
steps:
149224
- uses: actions/checkout@v4
150225

151-
- name: Use Node.js 22
226+
- name: Use Node.js ${{ env.LATEST_NODE_VERSION }}
152227
uses: actions/setup-node@v4
153228
with:
154-
node-version: 22
229+
node-version: ${{ env.LATEST_NODE_VERSION }}
155230

156231
- name: Enable corepack
157232
run: |
158233
corepack enable
159234
corepack prepare yarn@stable --activate
160235
161-
- name: Activate cache for Node.js 22
236+
- name: Activate cache for Node.js ${{ env.LATEST_NODE_VERSION }}
162237
uses: actions/setup-node@v4
163238
with:
164239
cache: yarn
165240

166241
- name: Install Dependencies
167242
run: yarn
168243

169-
- name: Run lint checks
170-
run: yarn lint
171-
172-
- name: Run format checks
173-
run: yarn format
244+
- name: Build & deploy docs
245+
run: |
246+
cd website
247+
yarn
248+
yarn build
174249
175250
build_bundles:
176-
name: Build Test Bundles (${{ matrix.label }})
177-
needs: [build_and_test]
251+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
252+
253+
name: Bundles (${{ matrix.label }})
254+
255+
needs: [build]
178256

179257
strategy:
180258
fail-fast: false
@@ -192,17 +270,17 @@ jobs:
192270
steps:
193271
- uses: actions/checkout@v4
194272

195-
- name: Use Node.js 22
273+
- name: Use Node.js ${{ env.LATEST_NODE_VERSION }}
196274
uses: actions/setup-node@v4
197275
with:
198-
node-version: 22
276+
node-version: ${{ env.LATEST_NODE_VERSION }}
199277

200278
- name: Enable corepack
201279
run: |
202280
corepack enable
203281
corepack prepare yarn@stable --activate
204282
205-
- name: Activate cache for Node.js 22
283+
- name: Activate cache for Node.js ${{ env.LATEST_NODE_VERSION }}
206284
uses: actions/setup-node@v4
207285
with:
208286
cache: yarn

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"format": "biome format . && prettier --check \"**/*.{md,yml,yaml}\"",
1919
"format:fix": "biome format --write . && prettier --write \"**/*.{md,yml,yaml}\"",
2020
"clean": "rimraf dist",
21-
"build": "yarn clean && tsc && tsc -p tsconfig.typechecking.json",
21+
"build": "yarn clean && tsc",
2222
"build-bundles": "bun run scripts/build-cli-bundles.ts",
2323
"prepack": "yarn insert-cli-metadata && yarn build && yarn update-docs",
2424
"insert-cli-metadata": "tsx scripts/insert-cli-metadata.ts",

tsconfig.typechecking.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)