Skip to content

Commit

Permalink
ci: Remove Rust/Go toolchain for examples tests (#4969)
Browse files Browse the repository at this point in the history
Examples tests do not use a local build of Turborepo, so
we do not need the toolchain for that.
  • Loading branch information
mehulkar committed May 17, 2023
1 parent 29284c8 commit f89354f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-rust/action.yml
Expand Up @@ -69,11 +69,11 @@ runs:
save-if: ${{ github.ref == 'refs/heads/main' && inputs.save-cache || 'false' }}

- name: "Install cargo-sweep"
if: ${{ inputs.install-cargo-sweep }} == "true"
if: ${{ inputs.install-cargo-sweep == 'true' }}
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-sweep

- name: "Run cargo-sweep"
if: ${{ inputs.install-cargo-sweep }} == "true"
if: ${{ inputs.install-cargo-sweep == 'true' }}
uses: ./.github/actions/cargo-sweep
14 changes: 14 additions & 0 deletions .github/actions/setup-turborepo-environment/action.yml
Expand Up @@ -7,25 +7,39 @@ inputs:
github-token:
description: "GitHub token. You can pass secrets.GITHUB_TOKEN"
required: true
setup-rust:
description: "Install Rust toolchain to build Turborepo"
required: false
type: boolean
default: true
setup-go:
description: "Install Go toolchain to build Turborepo"
required: false
type: boolean
default: true

runs:
using: "composite"
steps:
- name: "Setup Node"
uses: ./.github/actions/setup-node

- name: "Setup Go"
if: inputs.setup-go == 'true'
uses: ./.github/actions/setup-go
with:
github-token: ${{ inputs.github-token }}

- name: "Setup Rust"
if: inputs.setup-rust == 'true'
uses: ./.github/actions/setup-rust
with:
target: ${{ inputs.target }}
shared-cache-key: turborepo-debug-build
cache-key: ${{ inputs.target }}
save-cache: true
install-cargo-sweep: false

- name: Install Turbo globally
shell: bash
run: npm i -g turbo@canary
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -361,11 +361,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

# Note: the setup-node action inside this is somehow required for
# the node setup below this step. Not sure why.
- uses: ./.github/actions/setup-turborepo-environment
with:
target: ${{ matrix.os.name }}
github-token: "${{ secrets.GITHUB_TOKEN }}"
setup-rust: false
setup-go: false

# TODO: .github/actions/setup-node is pretty similar to the following
# steps (Setup Pnpm, pnpm cache, corepack, setup node), but it didn't
# work out of box. We should take another stab at it later.
- name: Setup Pnpm
uses: pnpm/action-setup@v2.2.4
with:
Expand Down

0 comments on commit f89354f

Please sign in to comment.