Skip to content

Commit

Permalink
CI check all tier 1 and tier 2 targets
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriteOvO committed Feb 5, 2025
1 parent ff21f40 commit f631936
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,33 +113,52 @@ jobs:
CARGO_TERM_COLOR=never cargo +nightly clippy --all-features --tests --examples 2>> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
check-matrix:
runs-on: ubuntu-latest
outputs:
targets_matrix: ${{ steps.gen-matrix.outputs.targets_matrix }}
steps:
- name: Install Rust nightly
run: rustup toolchain install nightly
- name: Generate matrix for all tier 1 and tier 2 targets
id: gen-matrix
run: |
TARGETS=$(rustc +nightly --print all-target-specs-json -Z unstable-options \
| jq -c "map_values(.metadata.tier) \
| to_entries \
| map({tier: .value, triplet: .key} \
| select(.tier == 1 or .tier == 2)) \
| sort_by(.tier)")
echo "targets_matrix=$TARGETS" >> "$GITHUB_OUTPUT"
echo $TARGETS | jq
check:
needs: check-matrix
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
target: ['', 'x86_64-apple-ios']
runs-on: ${{ matrix.os }}
target: ${{ fromJSON(needs.check-matrix.outputs.targets_matrix) }}
runs-on: 'ubuntu-latest'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Disable bench dependencies
run: ./.github/workflows/disable-bench-deps.sh
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo bash ./.github/workflows/install-deps.sh
- name: Install Rust target
if: matrix.target != ''
run: rustup target add ${{ matrix.target }}
- name: Install Rust tier ${{ matrix.target.tier }} target ${{ matrix.target.triplet }}
run: rustup target add ${{ matrix.target.triplet }}
- name: Restore cargo caches
uses: Swatinem/rust-cache@v2
- name: Run check
- name: Run check for tier ${{ matrix.target.tier }} target ${{ matrix.target.triplet }}
run: |
if [[ -z "${{ matrix.target }}" ]]; then
cargo check --all-features
else
cargo check --all-features --target ${{ matrix.target }}
fi
FEATURES=$(cargo metadata --format-version=1 --no-deps \
| jq ".packages[] \
| select(.name == \"spdlog-rs\") \
| .features \
| keys \
| map(select(contains(\"libsystemd\") | not)) \
| join(\",\")")
echo "Checking with features: $FEATURES"
cargo check --features $FEATURES --target ${{ matrix.target.triplet }}
check-doc:
strategy:
Expand Down

0 comments on commit f631936

Please sign in to comment.