Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,40 @@ name: CI
on: [push, pull_request]

jobs:
metadata:
name: Extract crate metadata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: Extract crate metadata
id: metadata
run: |
cargo metadata --no-deps --format-version=1 \
| jq -r '.packages[0]
| {name, version, rust_version}
| to_entries
| map("\(.key)=\(.value)")
| join("\n")' \
| tee -a $GITHUB_OUTPUT
outputs:
name: ${{ steps.metadata.outputs.name }}
version: ${{ steps.metadata.outputs.version }}
rust_version: ${{ steps.metadata.outputs.rust_version }}

ci:
needs: [metadata]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain: [nightly]
rust-toolchain: [nightly, "${{ needs.metadata.outputs.rust_version }}"]
targets: [x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat]
exclude:
# component 'rust-std' for target 'x86_64-unknown-none' is unavailable for channel '1.57'
- rust-toolchain: "${{ needs.metadata.outputs.rust_version }}"
targets: x86_64-unknown-none
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
Expand All @@ -26,7 +53,7 @@ jobs:
- name: Build
run: cargo build --target ${{ matrix.targets }} --all-features
- name: Unit test
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' }}
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' && matrix.rust-toolchain != '${{ needs.metadata.outputs.rust_version }}' }}
run: cargo test --target ${{ matrix.targets }} -- --nocapture

doc:
Expand Down