|
13 | 13 | OLDSTABLE_VERSION: 1
|
14 | 14 | OLDOLDSTABLE_VERSION: 0.5
|
15 | 15 | OLDOLDOLDSTABLE_VERSION: 0.4
|
| 16 | + QEMU_VERSION: 8.2.0 |
| 17 | + QEMU_URL: https://download.qemu.org/qemu-8.2.0.tar.xz |
16 | 18 |
|
17 | 19 | jobs:
|
18 | 20 | # Run cargo xtask format-check
|
@@ -170,9 +172,64 @@ jobs:
|
170 | 172 | - name: Check the examples
|
171 | 173 | run: cargo xtask usage-example-build
|
172 | 174 |
|
| 175 | + buildqemu: |
| 176 | + name: Get modern QEMU, build and store |
| 177 | + runs-on: ubuntu-22.04 |
| 178 | + steps: |
| 179 | + - name: Checkout |
| 180 | + uses: actions/checkout@v4 |
| 181 | + |
| 182 | + - name: Cache QEMU build |
| 183 | + id: cache-qemu |
| 184 | + uses: actions/cache@v4 |
| 185 | + with: |
| 186 | + path: qemu-${{ env.QEMU_VERSION }}/build |
| 187 | + key: ${{ runner.OS }}-qemu-${{ env.QEMU_VERSION }} |
| 188 | + restore-keys: | |
| 189 | + ${{ runner.OS }}-qemu-${{ env.QEMU_VERSION }} |
| 190 | + ${{ runner.OS }}-qemu- |
| 191 | +
|
| 192 | + - name: Install QEMU to get dependencies |
| 193 | + run: | |
| 194 | + sudo apt update |
| 195 | + sudo apt install -y qemu-system-arm |
| 196 | + sudo apt-get install git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build |
| 197 | +
|
| 198 | + - if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }} |
| 199 | + name: Download QEMU |
| 200 | + run: wget "${{ env.QEMU_URL }}" |
| 201 | + |
| 202 | + - if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }} |
| 203 | + name: Extract QEMU |
| 204 | + run: tar xvJf qemu-${{ env.QEMU_VERSION }}.tar.xz |
| 205 | + |
| 206 | + - if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }} |
| 207 | + name: Configure QEMU |
| 208 | + run: | |
| 209 | + cd qemu-${{ env.QEMU_VERSION }} |
| 210 | + ./configure --target-list=arm-softmmu,riscv32-softmmu |
| 211 | +
|
| 212 | + - if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }} |
| 213 | + name: Build QEMU |
| 214 | + run: | |
| 215 | + cd qemu-${{ env.QEMU_VERSION }} |
| 216 | + make -j$(nproc) |
| 217 | + |
| 218 | + - name: Archive QEMU build |
| 219 | + run: | |
| 220 | + cd qemu-${{ env.QEMU_VERSION }}/build |
| 221 | + tar -cf $GITHUB_WORKSPACE/qemu.tar * |
| 222 | +
|
| 223 | + - name: Store QEMU build |
| 224 | + uses: actions/upload-artifact@v4 |
| 225 | + with: |
| 226 | + name: qemu |
| 227 | + path: qemu.tar |
| 228 | + |
173 | 229 | # Verify the example output with run-pass tests
|
174 | 230 | testexamples:
|
175 | 231 | name: QEMU run
|
| 232 | + needs: buildqemu |
176 | 233 | runs-on: ubuntu-22.04
|
177 | 234 | strategy:
|
178 | 235 | matrix:
|
@@ -207,11 +264,24 @@ jobs:
|
207 | 264 | - name: Cache Dependencies
|
208 | 265 | uses: Swatinem/rust-cache@v2
|
209 | 266 |
|
210 |
| - - name: Install QEMU |
| 267 | + - name: Install QEMU to get dependencies |
211 | 268 | run: |
|
212 | 269 | sudo apt update
|
213 | 270 | sudo apt install -y qemu-system-arm
|
214 | 271 |
|
| 272 | + - name: Download built QEMU |
| 273 | + uses: actions/download-artifact@v4 |
| 274 | + with: |
| 275 | + name: qemu |
| 276 | + |
| 277 | + - name: Extract QEMU into local path |
| 278 | + run: tar -xf qemu.tar -C /usr/local/bin |
| 279 | + |
| 280 | + - name: Check which QEMU is used |
| 281 | + run: | |
| 282 | + which qemu-system-arm |
| 283 | + which qemu-system-riscv32 |
| 284 | +
|
215 | 285 | - name: Run-pass tests
|
216 | 286 | run: cargo xtask --deny-warnings --backend ${{ matrix.backend }} qemu
|
217 | 287 |
|
|
0 commit comments