name: CI permissions: contents: read on: pull_request: push: branches: - main - dev - staging - v[0-9]+.[0-9]+ schedule: - cron: '0 1 * * *' workflow_dispatch: env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 CARGO_TERM_COLOR: always RUST_BACKTRACE: full RUSTDOCFLAGS: -D warnings RUSTFLAGS: -D warnings RUSTUP_MAX_RETRIES: 10 defaults: run: shell: bash jobs: test: strategy: fail-fast: false matrix: rust: - 1.37 - stable - beta - nightly runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: persist-credentials: false - uses: taiki-e/github-actions/install-rust@main with: toolchain: ${{ matrix.rust }} component: rustfmt,rust-src target: thumbv7m-none-eabi - uses: dtolnay/install@cargo-expand if: startsWith(matrix.rust, 'nightly') - run: cargo test --all --all-features - run: cargo build --manifest-path tests/no-std/Cargo.toml --target thumbv7m-none-eabi msrv: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: persist-credentials: false - uses: taiki-e/install-action@cargo-hack - run: cargo hack build --workspace --ignore-private --no-dev-deps --version-range .. --version-step 2 miri: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: persist-credentials: false - uses: taiki-e/github-actions/install-rust@main with: component: miri - run: cargo miri test --workspace --all-features env: MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout tidy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: persist-credentials: false - uses: taiki-e/github-actions/install-rust@main with: component: clippy,rustfmt - uses: taiki-e/install-action@cargo-hack - uses: taiki-e/install-action@cargo-minimal-versions - uses: taiki-e/install-action@shellcheck - run: cargo fmt --all --check if: always() - run: cargo clippy --workspace --all-features --all-targets if: always() - run: cargo minimal-versions build --workspace --all-features --ignore-private if: always() - run: shellcheck $(git ls-files '*.sh') if: always() docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: persist-credentials: false - uses: taiki-e/github-actions/install-rust@main - run: cargo doc --workspace --all-features # This job doesn't actually test anything, but they're used to tell bors the # build completed, as there is no practical way to detect when a workflow is # successful listening to webhooks only. # # ALL THE PREVIOUS JOBS NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB! ci-success: name: ci if: github.event_name == 'push' && success() needs: - test - msrv - miri - tidy - docs runs-on: ubuntu-latest steps: - name: Mark the job as a success run: exit 0