123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- # CI for the whole Cargo workspace. Although having two relatively independent
- # crates in this workspace (as they do not get released together, as for example
- # tokio with its sub crates), a PR for a certain CI may report errors in the
- # other workspace members. I think this is unfortunate. I've experimented with
- # CI runs per workspace member but the complexity in the end was not worth it.
- # Instead, it is the right thing that the CI always covers the whole repository
- # and that it is as stable as possible.
- name: "Cargo workspace"
- # Run on every push (tag, branch) and pull_request
- on: [pull_request, push, workflow_dispatch]
- env:
- CARGO_TERM_COLOR: always
- jobs:
- ### Regular Build #########################
- build_msrv:
- name: build (msrv)
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: 1.68.0 # MSRV
- do-style-check: false
- features: builder
- build_stable:
- name: build (stable)
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: stable
- do-style-check: false
- features: builder
- build_nightly:
- name: build (nightly)
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: nightly
- do-style-check: false
- features: builder,unstable
- ### no-std Build #########################
- build_nostd_msrv:
- name: build no_std (msrv)
- needs: build_msrv
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: 1.68.0 # MSRV
- do-style-check: false
- rust-target: thumbv7em-none-eabihf
- features: builder
- build_nostd_stable:
- name: build no_std (stable)
- needs: build_stable
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: stable
- do-style-check: false
- rust-target: thumbv7em-none-eabihf
- features: builder
- # Also tests the build one time without the "builder" feature.
- build_nostd_stable_no_builder:
- name: build no_std (stable) [w/o builder]
- needs: build_stable
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: stable
- do-style-check: false
- rust-target: thumbv7em-none-eabihf
- # We perform one single run also in Windows. This should be sufficient to
- # check that devs can also use this on Windows.
- build_nostd_stable_windows:
- name: build no_std (stable) [Windows]
- needs: build_stable
- uses: ./.github/workflows/_build-rust.yml
- with:
- runs-on: windows-latest
- # Quirk for the Windows powershell and its handling of empty arguments.
- # features: >
- # '""'
- rust-version: stable
- do-style-check: false
- rust-target: thumbv7em-none-eabihf
- features: builder
- build_nostd_nightly:
- name: build no_std (nightly)
- needs: build_nightly
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: nightly
- do-style-check: false
- rust-target: thumbv7em-none-eabihf
- features: builder,unstable
- ### Style Checks + Doc #####################
- style_msrv:
- name: style (msrv)
- needs: build_msrv
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: 1.68.0 # MSRV
- do-style-check: true
- do-test: false
- features: builder
- style_stable:
- name: style (stable)
- needs: build_stable
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: stable
- do-style-check: true
- do-test: false
- features: builder
- style_nightly:
- name: style (nightly)
- needs: build_nightly
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: nightly
- do-style-check: true
- do-test: false
- features: builder,unstable
- integrationtest:
- name: integrationtest
- needs:
- - build_nightly
- - build_nostd_nightly
- runs-on: ubuntu-latest
- steps:
- - name: Check out
- uses: actions/checkout@v3
- - uses: cachix/install-nix-action@v20
- with:
- # This channel is only required to invoke "nix-shell".
- # Everything inside that nix-shell will use a pinned version of
- # nixpkgs.
- nix_path: nixpkgs=channel:nixos-23.05
- - name: Set up cargo cache
- uses: actions/cache@v3
- continue-on-error: false
- with:
- path: |
- ~/.cargo/bin/
- ~/.cargo/registry/index/
- ~/.cargo/registry/cache/
- ~/.cargo/git/db/
- integration-test/bins/target/
- # Hash over Cargo.toml and Cargo.lock, as this might be copied to
- # projects that do not have a Cargo.lock in their repository tree!
- key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }}
- # Have all the "copying into Nix store" messages in a dedicated step for
- # better log visibility.
- - run: cd integration-test && nix-shell --run "echo OK" && cd ..
- # Now, run the actual test.
- - run: cd integration-test && nix-shell --run ./run.sh && cd ..
- miri:
- name: tests with miri (nightly)
- needs: build_nightly
- uses: ./.github/workflows/_build-rust.yml
- with:
- rust-version: nightly
- do-style-check: false
- do-test: false
- do-miri: true
- features: builder,unstable
|