123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- name: Build
- on:
- push:
- branches: [ main ]
- pull_request:
- branches: [ main ]
- env:
- CARGO_TERM_COLOR: always
- jobs:
- # Regular build (with std) + test execution
- build:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- rust:
- - stable
- - nightly
- - 1.52.1 # MSVR
- steps:
- - uses: actions/checkout@v3
- # Important preparation step: override the latest default Rust version in GitHub CI
- # with the current value of the iteration in the "strategy.matrix.rust"-array.
- - uses: actions-rs/toolchain@v1
- with:
- profile: default
- toolchain: ${{ matrix.rust }}
- override: true
- # helps to identify if the right cargo version is actually used
- - run: cargo version
- - name: Build
- run: cargo build --all-targets --verbose
- - name: Run tests
- run: cargo test --verbose
- # no-std build without tests
- build_no_std:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- rust:
- - stable
- - nightly
- - 1.52.1 # MSVR
- steps:
- - uses: actions/checkout@v3
- # Important preparation step: override the latest default Rust version in GitHub CI
- # with the current value of the iteration in the "strategy.matrix.rust"-array.
- - uses: actions-rs/toolchain@v1
- with:
- profile: default
- toolchain: ${{ matrix.rust }}
- override: true
- # helps to identify if the right cargo version is actually used
- - run: cargo version
- - name: "Rustup: install some no_std target"
- run: rustup target add thumbv7em-none-eabihf
- - name: Build (no_std)
- run: cargo build --target thumbv7em-none-eabihf
- # Tests that the unstable feature, which requires nightly, builds.
- build_unstable:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- rust:
- - nightly
- steps:
- - uses: actions/checkout@v3
- # Important preparation step: override the latest default Rust version in GitHub CI
- # with the current value of the iteration in the "strategy.matrix.rust"-array.
- - uses: actions-rs/toolchain@v1
- with:
- profile: default
- toolchain: ${{ matrix.rust }}
- override: true
- - name: Build (unstable)
- run: cargo build --all-targets --features unstable
- - name: Test (unstable)
- run: cargo test --all-targets --features unstable
- # As discussed, these tasks are optional for PRs.
- style_checks:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- rust:
- - 1.52.1 # MSVR
- steps:
- - uses: actions/checkout@v3
- # Important preparation step: override the latest default Rust version in GitHub CI
- # with the current value of the iteration in the "strategy.matrix.rust"-array.
- - uses: actions-rs/toolchain@v1
- with:
- profile: default
- toolchain: ${{ matrix.rust }}
- override: true
- # helps to identify if the right cargo version is actually used
- - run: cargo version
- - name: Rustfmt
- run: cargo fmt -- --check
- - name: Clippy
- run: cargo clippy --all-targets
- - name: Rustdoc
- run: cargo doc --document-private-items
|