Skip to content

Commit

Permalink
ci: split examples tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshew committed Jan 20, 2025
1 parent c0a1dbb commit ab4b030
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 38 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/examples-basic-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Examples tests
on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
basic-example:
name: "`basic` example tests"
timeout-minutes: 40
if: ${{ contains(github.event.pull_request.files.*.path, 'examples/basic/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

# Disable corepack. actions/setup-node invokes other package managers and
# that causes corepack to throw an error, so we disable it first.
- name: Disable corepack
shell: bash
run: corepack disable

- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
node-version: "22"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

- name: Check examples
if: ${{ contains(github.event.pull_request.files.*.path, 'examples/basic/') }}
shell: bash
run: turbo run test --filter="@turborepo-examples-tests/basic-*" --continue --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }} --env-mode=strict --concurrency=1

kitchen-sink:
name: "`kitchen-sink` example tests"
timeout-minutes: 40
if: ${{ contains(github.event.pull_request.files.*.path, 'examples/basic/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

# Disable corepack. actions/setup-node invokes other package managers and
# that causes corepack to throw an error, so we disable it first.
- name: Disable corepack
shell: bash
run: corepack disable

- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
node-version: "22"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

- name: Check examples
if: ${{ contains(github.event.pull_request.files.*.path, 'examples/kitchen-sink/') }}
shell: bash
run: turbo run test --filter="@turborepo-examples-tests/kitchen-sink-*" --continue --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }} --env-mode=strict --concurrency=1
38 changes: 0 additions & 38 deletions .github/workflows/turborepo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,44 +80,6 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

examples:
name: Turborepo Examples
timeout-minutes: 40

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

# Disable corepack. actions/setup-node invokes other package managers and
# that causes corepack to throw an error, so we disable it first.
- name: Disable corepack
shell: bash
run: corepack disable

- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
node-version: "18.20.2"

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo

- name: Check examples
shell: bash
# Concurrency being 1 is a big hammer here.
# It's a quick fix for non-deterministic behaviors we're seeing around package resolution.
# We could likely do some hacking to reparallelize this, but it's not worth it right now.
run: turbo run test --filter="@turborepo-examples-tests/*" --continue --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }} --env-mode=strict --concurrency=1

# Disable corepack again. actions/setup-node's "Post" step runs at the end of
# this job invokes other package managers, and corepack throws an error.
# (corepack was enabled from inside the tests above).
- name: Disable corepack again
shell: bash
run: corepack disable

rust_lint:
name: Rust lints
runs-on:
Expand Down

0 comments on commit ab4b030

Please sign in to comment.