|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: [ main ] |
| 4 | + pull_request: |
| 5 | + |
| 6 | +name: Build |
| 7 | + |
| 8 | +jobs: |
| 9 | + # Build the workspace for a target architecture |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + rust: [stable, 1.82] |
| 15 | + target: |
| 16 | + - armebv7r-none-eabi |
| 17 | + - armebv7r-none-eabihf |
| 18 | + - armv7r-none-eabi |
| 19 | + - armv7r-none-eabihf |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
| 23 | + - name: Install rust |
| 24 | + run: | |
| 25 | + rustup install ${{ matrix.rust }} |
| 26 | + rustup default ${{ matrix.rust }} |
| 27 | + rustup target add ${{ matrix.target }} |
| 28 | + - name: Build |
| 29 | + run: | |
| 30 | + cargo build --target ${{ matrix.target }} |
| 31 | +
|
| 32 | + # Build the host tools |
| 33 | + build-host: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + strategy: |
| 36 | + matrix: |
| 37 | + rust: [stable, 1.82] |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v4 |
| 41 | + - name: Install rust |
| 42 | + run: | |
| 43 | + rustup install ${{ matrix.rust }} |
| 44 | + rustup default ${{ matrix.rust }} |
| 45 | + - name: Build |
| 46 | + run: | |
| 47 | + cd arm-targets |
| 48 | + cargo build |
| 49 | +
|
| 50 | + # Build the workspace for the target architecture but using nightly to compile libcore |
| 51 | + build-tier3: |
| 52 | + runs-on: ubuntu-latest |
| 53 | + strategy: |
| 54 | + matrix: |
| 55 | + target: |
| 56 | + - armebv7r-none-eabi |
| 57 | + - armebv7r-none-eabihf |
| 58 | + - armv7r-none-eabi |
| 59 | + - armv7r-none-eabihf |
| 60 | + - armv8r-none-eabihf |
| 61 | + steps: |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@v4 |
| 64 | + - name: Install rust |
| 65 | + run: | |
| 66 | + rustup install nightly |
| 67 | + rustup default nightly |
| 68 | + rustup component add rust-src --toolchain nightly |
| 69 | + - name: Build |
| 70 | + run: | |
| 71 | + cargo build --target ${{ matrix.target }} -Zbuild-std=core |
| 72 | +
|
| 73 | + # Gather all the above build jobs together for the purposes of getting an overall pass-fail |
| 74 | + build-all: |
| 75 | + runs-on: ubuntu-latest |
| 76 | + needs: [build, build-tier3, build-host] |
| 77 | + steps: |
| 78 | + - run: /bin/true |
| 79 | + |
| 80 | + # Build the docs for the workspace |
| 81 | + docs: |
| 82 | + runs-on: ubuntu-latest |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + rust: [stable, 1.82] |
| 86 | + target: |
| 87 | + - armebv7r-none-eabi |
| 88 | + - armebv7r-none-eabihf |
| 89 | + - armv7r-none-eabi |
| 90 | + - armv7r-none-eabihf |
| 91 | + steps: |
| 92 | + - name: Checkout |
| 93 | + uses: actions/checkout@v4 |
| 94 | + - name: Install rust |
| 95 | + run: | |
| 96 | + rustup install ${{ matrix.rust }} |
| 97 | + rustup default ${{ matrix.rust }} |
| 98 | + rustup target add ${{ matrix.target }} |
| 99 | + - name: Build docs |
| 100 | + run: | |
| 101 | + cargo doc --target ${{ matrix.target }} |
| 102 | +
|
| 103 | + # Build the docs for the host tools |
| 104 | + docs-host: |
| 105 | + runs-on: ubuntu-latest |
| 106 | + strategy: |
| 107 | + matrix: |
| 108 | + rust: [stable, 1.82] |
| 109 | + steps: |
| 110 | + - name: Checkout |
| 111 | + uses: actions/checkout@v4 |
| 112 | + - name: Install rust |
| 113 | + run: | |
| 114 | + rustup install ${{ matrix.rust }} |
| 115 | + rustup default ${{ matrix.rust }} |
| 116 | + - name: Build docs |
| 117 | + run: | |
| 118 | + cd arm-targets |
| 119 | + cargo doc |
| 120 | +
|
| 121 | + # Gather all the above doc jobs together for the purposes of getting an overall pass-fail |
| 122 | + docs-all: |
| 123 | + runs-on: ubuntu-latest |
| 124 | + needs: [docs, docs-host] |
| 125 | + steps: |
| 126 | + - run: /bin/true |
| 127 | + |
| 128 | + # Format the workspace |
| 129 | + fmt: |
| 130 | + runs-on: ubuntu-latest |
| 131 | + steps: |
| 132 | + - name: Checkout |
| 133 | + uses: actions/checkout@v4 |
| 134 | + - name: Install rust |
| 135 | + run: | |
| 136 | + rustup install stable |
| 137 | + rustup default stable |
| 138 | + - name: Format |
| 139 | + run: | |
| 140 | + cargo fmt --check |
| 141 | +
|
| 142 | + # Format the host tools |
| 143 | + fmt-host: |
| 144 | + runs-on: ubuntu-latest |
| 145 | + steps: |
| 146 | + - name: Checkout |
| 147 | + uses: actions/checkout@v4 |
| 148 | + - name: Install rust |
| 149 | + run: | |
| 150 | + rustup install stable |
| 151 | + rustup default stable |
| 152 | + - name: Format |
| 153 | + run: | |
| 154 | + cd arm-targets |
| 155 | + cargo fmt --check |
| 156 | +
|
| 157 | + # Gather all the above fmt jobs together for the purposes of getting an overall pass-fail |
| 158 | + fmt-all: |
| 159 | + runs-on: ubuntu-latest |
| 160 | + needs: [fmt, fmt-host] |
| 161 | + steps: |
| 162 | + - run: /bin/true |
| 163 | + |
| 164 | + # Run clippy on the workpace |
| 165 | + clippy: |
| 166 | + runs-on: ubuntu-latest |
| 167 | + strategy: |
| 168 | + matrix: |
| 169 | + rust: [stable, 1.82] |
| 170 | + target: |
| 171 | + - armebv7r-none-eabi |
| 172 | + - armebv7r-none-eabihf |
| 173 | + - armv7r-none-eabi |
| 174 | + - armv7r-none-eabihf |
| 175 | + steps: |
| 176 | + - name: Checkout |
| 177 | + uses: actions/checkout@v4 |
| 178 | + - name: Install rust |
| 179 | + run: | |
| 180 | + rustup install ${{ matrix.rust }} |
| 181 | + rustup default ${{ matrix.rust }} |
| 182 | + rustup target add ${{ matrix.target }} |
| 183 | + rustup component add clippy |
| 184 | + - name: Clippy |
| 185 | + run: | |
| 186 | + cargo clippy --target ${{ matrix.target }} |
| 187 | +
|
| 188 | + # Run clippy on the host tools |
| 189 | + clippy-host: |
| 190 | + runs-on: ubuntu-latest |
| 191 | + strategy: |
| 192 | + matrix: |
| 193 | + rust: [stable, 1.82] |
| 194 | + steps: |
| 195 | + - name: Checkout |
| 196 | + uses: actions/checkout@v4 |
| 197 | + - name: Install rust |
| 198 | + run: | |
| 199 | + rustup install ${{ matrix.rust }} |
| 200 | + rustup default ${{ matrix.rust }} |
| 201 | + rustup component add clippy |
| 202 | + - name: Clippy |
| 203 | + run: | |
| 204 | + cd arm-targets |
| 205 | + cargo clippy |
| 206 | +
|
| 207 | + # Gather all the above clippy jobs together for the purposes of getting an overall pass-fail |
| 208 | + clippy-all: |
| 209 | + runs-on: ubuntu-latest |
| 210 | + needs: [clippy, clippy-host] |
| 211 | + steps: |
| 212 | + - run: /bin/true |
| 213 | + |
| 214 | + # Run some programs in QEMU |
| 215 | + test: |
| 216 | + runs-on: ubuntu-latest |
| 217 | + needs: [build-all] |
| 218 | + steps: |
| 219 | + - run: sudo apt-get -y update && sudo apt-get -y install qemu-system-arm |
| 220 | + - name: Checkout |
| 221 | + uses: actions/checkout@v4 |
| 222 | + - run: ./tests.sh |
| 223 | + |
| 224 | + # Gather all the above xxx-all jobs together for the purposes of getting an overall pass-fail |
| 225 | + all: |
| 226 | + runs-on: ubuntu-latest |
| 227 | + needs: [docs-all, build-all, fmt-all, test] # not gating on clippy-all |
| 228 | + steps: |
| 229 | + - run: /bin/true |
0 commit comments