diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-11-15 20:14:59 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-11-22 01:25:07 +0100 |
| commit | c8e69a14eb223f2c13d545b0063fea8fe9c2148f (patch) | |
| tree | 178989733f5d6462b964c88b028b0140752dc62c /.github | |
| parent | 10a3a8bbed24425832becc83d07651bb3682a021 (diff) | |
Faster CI with cargo-batch
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/rust.yml | 160 |
1 files changed, 16 insertions, 144 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index de500c3a7..055089bd9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml | |||
| @@ -2,9 +2,9 @@ name: Rust | |||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | branches: [ staging, trying, master ] | 5 | branches: [staging, trying, master] |
| 6 | pull_request: | 6 | pull_request: |
| 7 | branches: [ master ] | 7 | branches: [master] |
| 8 | 8 | ||
| 9 | env: | 9 | env: |
| 10 | CARGO_TERM_COLOR: always | 10 | CARGO_TERM_COLOR: always |
| @@ -12,162 +12,37 @@ env: | |||
| 12 | jobs: | 12 | jobs: |
| 13 | all: | 13 | all: |
| 14 | runs-on: ubuntu-20.04 | 14 | runs-on: ubuntu-20.04 |
| 15 | needs: [build, fmt, test, metapac_gen] | 15 | needs: [build, test, metapac_gen] |
| 16 | steps: | 16 | steps: |
| 17 | - name: Done | 17 | - name: Done |
| 18 | run: exit 0 | 18 | run: exit 0 |
| 19 | build: | 19 | build: |
| 20 | runs-on: ubuntu-latest | 20 | runs-on: ubuntu-latest |
| 21 | strategy: | ||
| 22 | matrix: | ||
| 23 | include: | ||
| 24 | - package: embassy | ||
| 25 | target: thumbv7em-none-eabi | ||
| 26 | - package: embassy | ||
| 27 | target: thumbv7em-none-eabi | ||
| 28 | features: log,executor-agnostic | ||
| 29 | - package: embassy | ||
| 30 | target: thumbv7em-none-eabi | ||
| 31 | features: defmt | ||
| 32 | - package: embassy | ||
| 33 | target: thumbv6m-none-eabi | ||
| 34 | features: defmt | ||
| 35 | |||
| 36 | - package: examples/std | ||
| 37 | target: x86_64-unknown-linux-gnu | ||
| 38 | |||
| 39 | - package: embassy-nrf | ||
| 40 | target: thumbv7em-none-eabi | ||
| 41 | features: nrf52805 | ||
| 42 | - package: embassy-nrf | ||
| 43 | target: thumbv7em-none-eabi | ||
| 44 | features: nrf52810 | ||
| 45 | - package: embassy-nrf | ||
| 46 | target: thumbv7em-none-eabi | ||
| 47 | features: nrf52811 | ||
| 48 | - package: embassy-nrf | ||
| 49 | target: thumbv7em-none-eabi | ||
| 50 | features: nrf52820 | ||
| 51 | - package: embassy-nrf | ||
| 52 | target: thumbv7em-none-eabi | ||
| 53 | features: nrf52832 | ||
| 54 | - package: embassy-nrf | ||
| 55 | target: thumbv7em-none-eabi | ||
| 56 | features: nrf52833 | ||
| 57 | - package: embassy-nrf | ||
| 58 | target: thumbv8m.main-none-eabihf | ||
| 59 | features: nrf9160-s | ||
| 60 | - package: embassy-nrf | ||
| 61 | target: thumbv8m.main-none-eabihf | ||
| 62 | features: nrf9160-ns | ||
| 63 | - package: embassy-nrf | ||
| 64 | target: thumbv8m.main-none-eabihf | ||
| 65 | features: nrf5340-app-s | ||
| 66 | - package: embassy-nrf | ||
| 67 | target: thumbv8m.main-none-eabihf | ||
| 68 | features: nrf5340-app-ns | ||
| 69 | - package: embassy-nrf | ||
| 70 | target: thumbv8m.main-none-eabihf | ||
| 71 | features: nrf5340-net | ||
| 72 | - package: embassy-nrf | ||
| 73 | target: thumbv7em-none-eabi | ||
| 74 | features: nrf52840 | ||
| 75 | - package: embassy-nrf | ||
| 76 | target: thumbv7em-none-eabi | ||
| 77 | features: nrf52840,log | ||
| 78 | - package: embassy-nrf | ||
| 79 | target: thumbv7em-none-eabi | ||
| 80 | features: nrf52840,defmt | ||
| 81 | - package: examples/nrf | ||
| 82 | target: thumbv7em-none-eabi | ||
| 83 | |||
| 84 | - package: examples/rp | ||
| 85 | target: thumbv6m-none-eabi | ||
| 86 | |||
| 87 | - package: embassy-stm32 | ||
| 88 | target: thumbv7em-none-eabi | ||
| 89 | features: stm32f411ce,defmt | ||
| 90 | - package: embassy-stm32 | ||
| 91 | target: thumbv7em-none-eabi | ||
| 92 | features: stm32f429zi,log | ||
| 93 | - package: embassy-stm32 | ||
| 94 | target: thumbv7em-none-eabi | ||
| 95 | features: stm32h755zi_cm7,defmt | ||
| 96 | - package: embassy-stm32 | ||
| 97 | target: thumbv7em-none-eabi | ||
| 98 | features: stm32l476vg,defmt | ||
| 99 | - package: embassy-stm32 | ||
| 100 | target: thumbv6m-none-eabi | ||
| 101 | features: stm32l072cz,defmt | ||
| 102 | - package: embassy-stm32 | ||
| 103 | target: thumbv7m-none-eabi | ||
| 104 | features: stm32l151cb-a,defmt | ||
| 105 | - package: examples/stm32f4 | ||
| 106 | target: thumbv7em-none-eabi | ||
| 107 | - package: examples/stm32l4 | ||
| 108 | target: thumbv7em-none-eabi | ||
| 109 | - package: examples/stm32h7 | ||
| 110 | target: thumbv7em-none-eabi | ||
| 111 | - package: examples/stm32l0 | ||
| 112 | target: thumbv6m-none-eabi | ||
| 113 | - package: examples/stm32l1 | ||
| 114 | target: thumbv7m-none-eabi | ||
| 115 | - package: examples/stm32wb55 | ||
| 116 | target: thumbv7em-none-eabihf | ||
| 117 | - package: examples/stm32wl55 | ||
| 118 | target: thumbv7em-none-eabihf | ||
| 119 | - package: examples/stm32f0 | ||
| 120 | target: thumbv6m-none-eabi | ||
| 121 | - package: examples/stm32g0 | ||
| 122 | target: thumbv6m-none-eabi | ||
| 123 | - package: examples/wasm | ||
| 124 | target: wasm32-unknown-unknown | ||
| 125 | - package: examples/stm32f1 | ||
| 126 | target: thumbv7m-none-eabi | ||
| 127 | - package: examples/stm32f7 | ||
| 128 | target: thumbv7em-none-eabihf | ||
| 129 | - package: examples/stm32u5 | ||
| 130 | target: thumbv7em-none-eabihf | ||
| 131 | steps: | 21 | steps: |
| 132 | - uses: actions/checkout@v2 | 22 | - uses: actions/checkout@v2 |
| 133 | with: | 23 | with: |
| 134 | submodules: true | 24 | submodules: true |
| 135 | - uses: actions-rs/toolchain@v1 | 25 | - name: Cache multiple paths |
| 136 | with: | ||
| 137 | toolchain: stable | ||
| 138 | - name: cache | ||
| 139 | id: cache-target | ||
| 140 | uses: actions/cache@v2 | 26 | uses: actions/cache@v2 |
| 141 | with: | 27 | with: |
| 142 | path: target | 28 | path: | |
| 143 | key: ${{ runner.os }}-${{ matrix.target }} | 29 | ~/.cargo/bin/ |
| 144 | 30 | ~/.cargo/registry/index/ | |
| 145 | # We have to append the "-D warnings" flag to .cargo/config rather than | 31 | ~/.cargo/registry/cache/ |
| 146 | # using the RUSTFLAGS environment variable because if we set RUSTFLAGS | 32 | ~/.cargo/git/db/ |
| 147 | # cargo will ignore the rustflags config in .cargo/config. | 33 | target_ci |
| 148 | - name: Check | 34 | key: rust3-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }} |
| 35 | - name: build | ||
| 149 | run: | | 36 | run: | |
| 150 | mkdir -p .cargo | 37 | curl -L -o /usr/local/bin/cargo-batch https://github.com/embassy-rs/cargo-batch/releases/download/batch-0.1.0/cargo-batch |
| 151 | echo -e '[target."cfg(all())"]\nrustflags = ["-D", "warnings"]' >> .cargo/config | 38 | chmod +x /usr/local/bin/cargo-batch |
| 152 | cd ${{ matrix.package }} && RUSTFLAGS=-Dwarnings cargo check --features=${{ matrix.features }} --target=${{ matrix.target }} | 39 | ./ci.sh |
| 153 | 40 | rm -rf target_ci/*{,/release}/{build,deps,.fingerprint}/{lib,}{embassy,stm32}* | |
| 154 | fmt: | ||
| 155 | runs-on: ubuntu-latest | ||
| 156 | steps: | ||
| 157 | - uses: actions/checkout@v2 | ||
| 158 | - uses: actions-rs/toolchain@v1 | ||
| 159 | with: | ||
| 160 | toolchain: stable | ||
| 161 | - name: Check fmt | ||
| 162 | run: find -name '*.rs' | xargs rustfmt --check --skip-children --unstable-features --edition 2018 | ||
| 163 | 41 | ||
| 164 | test: | 42 | test: |
| 165 | runs-on: ubuntu-latest | 43 | runs-on: ubuntu-latest |
| 166 | steps: | 44 | steps: |
| 167 | - uses: actions/checkout@v2 | 45 | - uses: actions/checkout@v2 |
| 168 | - uses: actions-rs/toolchain@v1 | ||
| 169 | with: | ||
| 170 | toolchain: stable | ||
| 171 | - name: Test | 46 | - name: Test |
| 172 | run: cd embassy && cargo test | 47 | run: cd embassy && cargo test |
| 173 | 48 | ||
| @@ -177,8 +52,5 @@ jobs: | |||
| 177 | - uses: actions/checkout@v2 | 52 | - uses: actions/checkout@v2 |
| 178 | with: | 53 | with: |
| 179 | submodules: true | 54 | submodules: true |
| 180 | - uses: actions-rs/toolchain@v1 | ||
| 181 | with: | ||
| 182 | toolchain: stable | ||
| 183 | - name: Generate pregenerated metapac | 55 | - name: Generate pregenerated metapac |
| 184 | run: cd stm32-metapac-gen; cargo run --release | 56 | run: cd stm32-metapac-gen; cargo run --release |
