Skip to content

Commit ab4b030

Browse files
committed
ci: split examples tests
1 parent c0a1dbb commit ab4b030

File tree

2 files changed

+68
-38
lines changed

2 files changed

+68
-38
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Examples tests
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
10+
11+
jobs:
12+
basic-example:
13+
name: "`basic` example tests"
14+
timeout-minutes: 40
15+
if: ${{ contains(github.event.pull_request.files.*.path, 'examples/basic/') }}
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
# Disable corepack. actions/setup-node invokes other package managers and
22+
# that causes corepack to throw an error, so we disable it first.
23+
- name: Disable corepack
24+
shell: bash
25+
run: corepack disable
26+
27+
- name: Setup Turborepo Environment
28+
uses: ./.github/actions/setup-turborepo-environment
29+
with:
30+
github-token: "${{ secrets.GITHUB_TOKEN }}"
31+
node-version: "22"
32+
33+
- name: Install Global Turbo
34+
uses: ./.github/actions/install-global-turbo
35+
36+
- name: Check examples
37+
if: ${{ contains(github.event.pull_request.files.*.path, 'examples/basic/') }}
38+
shell: bash
39+
run: turbo run test --filter="@turborepo-examples-tests/basic-*" --continue --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }} --env-mode=strict --concurrency=1
40+
41+
kitchen-sink:
42+
name: "`kitchen-sink` example tests"
43+
timeout-minutes: 40
44+
if: ${{ contains(github.event.pull_request.files.*.path, 'examples/basic/') }}
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v4
49+
50+
# Disable corepack. actions/setup-node invokes other package managers and
51+
# that causes corepack to throw an error, so we disable it first.
52+
- name: Disable corepack
53+
shell: bash
54+
run: corepack disable
55+
56+
- name: Setup Turborepo Environment
57+
uses: ./.github/actions/setup-turborepo-environment
58+
with:
59+
github-token: "${{ secrets.GITHUB_TOKEN }}"
60+
node-version: "22"
61+
62+
- name: Install Global Turbo
63+
uses: ./.github/actions/install-global-turbo
64+
65+
- name: Check examples
66+
if: ${{ contains(github.event.pull_request.files.*.path, 'examples/kitchen-sink/') }}
67+
shell: bash
68+
run: turbo run test --filter="@turborepo-examples-tests/kitchen-sink-*" --continue --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }} --env-mode=strict --concurrency=1

.github/workflows/turborepo-test.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -80,44 +80,6 @@ jobs:
8080
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
8181
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
8282

83-
examples:
84-
name: Turborepo Examples
85-
timeout-minutes: 40
86-
87-
runs-on: ubuntu-latest
88-
steps:
89-
- name: Checkout
90-
uses: actions/checkout@v4
91-
92-
# Disable corepack. actions/setup-node invokes other package managers and
93-
# that causes corepack to throw an error, so we disable it first.
94-
- name: Disable corepack
95-
shell: bash
96-
run: corepack disable
97-
98-
- name: Setup Turborepo Environment
99-
uses: ./.github/actions/setup-turborepo-environment
100-
with:
101-
github-token: "${{ secrets.GITHUB_TOKEN }}"
102-
node-version: "18.20.2"
103-
104-
- name: Install Global Turbo
105-
uses: ./.github/actions/install-global-turbo
106-
107-
- name: Check examples
108-
shell: bash
109-
# Concurrency being 1 is a big hammer here.
110-
# It's a quick fix for non-deterministic behaviors we're seeing around package resolution.
111-
# We could likely do some hacking to reparallelize this, but it's not worth it right now.
112-
run: turbo run test --filter="@turborepo-examples-tests/*" --continue --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }} --env-mode=strict --concurrency=1
113-
114-
# Disable corepack again. actions/setup-node's "Post" step runs at the end of
115-
# this job invokes other package managers, and corepack throws an error.
116-
# (corepack was enabled from inside the tests above).
117-
- name: Disable corepack again
118-
shell: bash
119-
run: corepack disable
120-
12183
rust_lint:
12284
name: Rust lints
12385
runs-on:

0 commit comments

Comments
 (0)