Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Adapt to github CI breaking env vars in matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienG2 committed Jan 12, 2024
1 parent dca20b2 commit bfa8907
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ env:
MINIMAL_RUST: 1.63.0 # Minimal Supported Rust Version

jobs:
# Workaround for github CI dropping env var expansion in matrix strategy
matrix_vars:
runs-on: ubuntu-latest
outputs:
MINIMAL_RUST: ${{ env.MINIMAL_RUST }}
steps:
- name: Forward env var to output
run: echo "MINIMAL_RUST=${{ env.MINIMAL_RUST }}" >> $GITHUB_OUTPUT


# Format doesn't depend on configuration, and lints don't depend on the
# operating system since there's no OS-specific code path in this crate.
#
Expand Down Expand Up @@ -72,6 +82,8 @@ jobs:

runs-on: ${{ matrix.os }}

needs: matrix_vars

strategy:
matrix:
os:
Expand All @@ -80,7 +92,7 @@ jobs:
- macos-latest
rust:
- stable
- $MINIMAL_RUST # Minimum supported Rust version
- ${{ needs.matrix_vars.outputs.MINIMAL_RUST }}

steps:
- name: Checkout sources
Expand Down Expand Up @@ -108,6 +120,8 @@ jobs:

runs-on: ${{ matrix.os }}

needs: matrix_vars

strategy:
matrix:
os:
Expand All @@ -117,7 +131,7 @@ jobs:
rust:
- beta
- nightly
- $MINIMAL_RUST # Compatibility can be broken by deps updates
- ${{ needs.matrix_vars.outputs.MINIMAL_RUST }}

steps:
- name: Checkout sources
Expand Down

0 comments on commit bfa8907

Please sign in to comment.