From d2e004ff55b11dc5525570a7a09fb8c869feec3a Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 20 Nov 2024 03:51:53 -0500 Subject: [PATCH] ci: use `env` rather than passing environment inline --- .github/workflows/ci.yaml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6be262823e38e..c03ae046aca79 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,12 +34,14 @@ jobs: - beta - nightly - 1.63.0 + env: + TOOLCHAIN: ${{ matrix.toolchain }} steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain - run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/install-rust.sh + run: ./ci/install-rust.sh - name: Execute build.sh - run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh + run: ./ci/build.sh build_channels_macos: name: Build Channels macOS @@ -56,12 +58,14 @@ jobs: - { toolchain: nightly, os: macos-14 } - { toolchain: 1.63.0, os: macos-14 } runs-on: ${{ matrix.target.os }} + env: + TOOLCHAIN: ${{ matrix.toolchain }} steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain - run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/install-rust.sh + run: ./ci/install-rust.sh - name: Execute build.sh - run: TOOLCHAIN=${{ matrix.target.toolchain }} ./ci/build.sh + run: ./ci/build.sh build_channels_windows: name: Build Channels Windows @@ -74,13 +78,15 @@ jobs: toolchain: - 1.63.0 - stable + env: + TOOLCHAIN: ${{ matrix.toolchain }} steps: - uses: actions/checkout@v4 - name: Self-update rustup run: rustup self update shell: bash - name: Execute build.sh - run: TOOLCHAIN=${{ matrix.toolchain }} ./ci/build.sh + run: ./ci/build.sh shell: bash macos: @@ -91,10 +97,12 @@ jobs: matrix: target: - aarch64-apple-darwin + env: + TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} ./ci/install-rust.sh + run: ./ci/install-rust.sh - name: Execute run.sh run: ./ci/run.sh ${{ matrix.target }} @@ -118,13 +126,15 @@ jobs: # ARCH_BITS: 32 # ARCH: i686 - target: i686-pc-windows-msvc + env: + TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v4 - name: Self-update rustup run: rustup self update shell: bash - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} ./ci/install-rust.sh + run: ./ci/install-rust.sh shell: bash - name: Execute run.sh run: ./ci/run.sh ${{ matrix.target }} @@ -140,10 +150,12 @@ jobs: target: - i686-unknown-linux-gnu - x86_64-unknown-linux-gnu + env: + TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} ./ci/install-rust.sh + run: ./ci/install-rust.sh - name: Execute run-docker.sh run: ./ci/run-docker.sh ${{ matrix.target }} @@ -182,10 +194,12 @@ jobs: # FIXME: It seems some items in `src/unix/mod.rs` # aren't defined on redox actually. # - x86_64-unknown-redox + env: + TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} ./ci/install-rust.sh + run: ./ci/install-rust.sh - name: Execute run-docker.sh run: ./ci/run-docker.sh ${{ matrix.target }} @@ -219,10 +233,12 @@ jobs: check_cfg: name: "Check #[cfg]s" runs-on: ubuntu-22.04 + env: + TOOLCHAIN: nightly steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain - run: TOOLCHAIN=nightly ./ci/install-rust.sh + run: ./ci/install-rust.sh - name: Build with check-cfg run: LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg