|
1 |
| -name: Build |
| 1 | +# CI for the whole Cargo workspace. Although having two relatively independent |
| 2 | +# crates in this workspace (as they do not get released together, as for example |
| 3 | +# tokio with its sub crates), a PR for a certain CI may report errors in the |
| 4 | +# other workspace members. I think this is unfortunate. I've experimented with |
| 5 | +# CI runs per workspace member but the complexity in the end was not worth it. |
| 6 | +# Instead, it is the right thing that the CI always covers the whole repository |
| 7 | +# and that it is as stable as possible. |
2 | 8 |
|
3 |
| -on: |
4 |
| - push: |
5 |
| - branches: [ main ] |
6 |
| - pull_request: |
7 |
| - branches: [ main ] |
| 9 | +name: "Cargo workspace" |
| 10 | + |
| 11 | +# Run on every push (tag, branch) and pull_request |
| 12 | +on: [pull_request, push, workflow_dispatch] |
8 | 13 |
|
9 | 14 | env:
|
10 | 15 | CARGO_TERM_COLOR: always
|
11 | 16 |
|
12 | 17 | jobs:
|
13 |
| - # Regular build (with std) + test execution |
14 |
| - build: |
15 |
| - runs-on: ubuntu-latest |
16 |
| - strategy: |
17 |
| - matrix: |
18 |
| - rust: |
19 |
| - - stable |
20 |
| - - nightly |
21 |
| - - 1.52.1 # MSVR |
22 |
| - steps: |
23 |
| - - uses: actions/checkout@v3 |
24 |
| - # Important preparation step: override the latest default Rust version in GitHub CI |
25 |
| - # with the current value of the iteration in the "strategy.matrix.rust"-array. |
26 |
| - - uses: actions-rs/toolchain@v1 |
27 |
| - with: |
28 |
| - profile: default |
29 |
| - toolchain: ${{ matrix.rust }} |
30 |
| - override: true |
31 |
| - # helps to identify if the right cargo version is actually used |
32 |
| - - run: cargo version |
33 |
| - - name: Build |
34 |
| - run: cargo build --all-targets --verbose |
35 |
| - - name: Run tests |
36 |
| - run: cargo test --verbose |
| 18 | + build_multiboot2_msrv: |
| 19 | + name: "build (msrv)" |
| 20 | + uses: ./.github/workflows/_build-rust.yml |
| 21 | + with: |
| 22 | + rust-version: 1.56.1 |
| 23 | + do-style-check: false |
| 24 | + |
| 25 | + build_multiboot2_stable: |
| 26 | + name: "build (stable)" |
| 27 | + uses: ./.github/workflows/_build-rust.yml |
| 28 | + with: |
| 29 | + rust-version: stable |
| 30 | + do-style-check: false |
| 31 | + |
| 32 | + build_multiboot2_nightly: |
| 33 | + name: "build (nightly)" |
| 34 | + uses: ./.github/workflows/_build-rust.yml |
| 35 | + with: |
| 36 | + rust-version: nightly |
| 37 | + do-style-check: false |
| 38 | + |
| 39 | + build_nostd_multiboot2_msrv: |
| 40 | + name: "build no_std (msrv)" |
| 41 | + uses: ./.github/workflows/_build-rust.yml |
| 42 | + with: |
| 43 | + rust-version: 1.56.1 |
| 44 | + do-style-check: false |
| 45 | + rust-target: thumbv7em-none-eabihf |
| 46 | + |
| 47 | + build_nostd_multiboot2_stable: |
| 48 | + name: "build no_std (stable)" |
| 49 | + uses: ./.github/workflows/_build-rust.yml |
| 50 | + with: |
| 51 | + rust-version: stable |
| 52 | + do-style-check: false |
| 53 | + rust-target: thumbv7em-none-eabihf |
37 | 54 |
|
38 |
| - # no-std build without tests |
39 |
| - build_no_std: |
40 |
| - runs-on: ubuntu-latest |
41 |
| - strategy: |
42 |
| - matrix: |
43 |
| - rust: |
44 |
| - - stable |
45 |
| - - nightly |
46 |
| - - 1.52.1 # MSVR |
47 |
| - steps: |
48 |
| - - uses: actions/checkout@v3 |
49 |
| - # Important preparation step: override the latest default Rust version in GitHub CI |
50 |
| - # with the current value of the iteration in the "strategy.matrix.rust"-array. |
51 |
| - - uses: actions-rs/toolchain@v1 |
52 |
| - with: |
53 |
| - profile: default |
54 |
| - toolchain: ${{ matrix.rust }} |
55 |
| - override: true |
56 |
| - # helps to identify if the right cargo version is actually used |
57 |
| - - run: cargo version |
58 |
| - - name: "Rustup: install some no_std target" |
59 |
| - run: rustup target add thumbv7em-none-eabihf |
60 |
| - - name: Build (no_std) |
61 |
| - run: cargo build --target thumbv7em-none-eabihf |
| 55 | + build_nostd_multiboot2_nightly: |
| 56 | + name: "build no_std (nightly)" |
| 57 | + uses: ./.github/workflows/_build-rust.yml |
| 58 | + with: |
| 59 | + rust-version: nightly |
| 60 | + do-style-check: false |
| 61 | + rust-target: thumbv7em-none-eabihf |
62 | 62 |
|
63 |
| - # Tests that the unstable feature, which requires nightly, builds. |
64 |
| - build_unstable: |
65 |
| - runs-on: ubuntu-latest |
66 |
| - strategy: |
67 |
| - matrix: |
68 |
| - rust: |
69 |
| - - nightly |
70 |
| - steps: |
71 |
| - - uses: actions/checkout@v3 |
72 |
| - # Important preparation step: override the latest default Rust version in GitHub CI |
73 |
| - # with the current value of the iteration in the "strategy.matrix.rust"-array. |
74 |
| - - uses: actions-rs/toolchain@v1 |
75 |
| - with: |
76 |
| - profile: default |
77 |
| - toolchain: ${{ matrix.rust }} |
78 |
| - override: true |
79 |
| - - name: Build (unstable) |
80 |
| - run: cargo build --all-targets --features unstable |
81 |
| - - name: Test (unstable) |
82 |
| - run: cargo test --all-targets --features unstable |
| 63 | + style_multiboot2_msrv: |
| 64 | + name: "style (msrv)" |
| 65 | + uses: ./.github/workflows/_build-rust.yml |
| 66 | + with: |
| 67 | + rust-version: 1.56.1 |
| 68 | + do-style-check: true |
| 69 | + do-test: false |
83 | 70 |
|
84 |
| - # As discussed, these tasks are optional for PRs. |
85 |
| - style_checks: |
86 |
| - runs-on: ubuntu-latest |
87 |
| - strategy: |
88 |
| - matrix: |
89 |
| - rust: |
90 |
| - - 1.52.1 # MSVR |
91 |
| - steps: |
92 |
| - - uses: actions/checkout@v3 |
93 |
| - # Important preparation step: override the latest default Rust version in GitHub CI |
94 |
| - # with the current value of the iteration in the "strategy.matrix.rust"-array. |
95 |
| - - uses: actions-rs/toolchain@v1 |
96 |
| - with: |
97 |
| - profile: default |
98 |
| - toolchain: ${{ matrix.rust }} |
99 |
| - override: true |
100 |
| - # helps to identify if the right cargo version is actually used |
101 |
| - - run: cargo version |
102 |
| - - name: Rustfmt |
103 |
| - run: cargo fmt -- --check |
104 |
| - - name: Clippy |
105 |
| - run: cargo clippy --all-targets |
106 |
| - - name: Rustdoc |
107 |
| - run: cargo doc --document-private-items |
| 71 | + style_multiboot2_stable: |
| 72 | + name: "style (stable)" |
| 73 | + uses: ./.github/workflows/_build-rust.yml |
| 74 | + with: |
| 75 | + rust-version: stable |
| 76 | + do-style-check: true |
| 77 | + do-test: false |
0 commit comments