|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: [ master, riscv-pac ] |
| 4 | + pull_request: |
| 5 | + merge_group: |
| 6 | + |
| 7 | +name: Build check (riscv-pac) |
| 8 | + |
| 9 | +jobs: |
| 10 | + # We check that the crate builds and links for all the toolchains and targets. |
| 11 | + build-riscv: |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + # All generated code should be running on stable now, MRSV is 1.60.0 |
| 15 | + toolchain: [ stable, nightly, 1.60.0 ] |
| 16 | + target: |
| 17 | + - riscv32i-unknown-none-elf |
| 18 | + - riscv32imc-unknown-none-elf |
| 19 | + - riscv32imac-unknown-none-elf |
| 20 | + - riscv64imac-unknown-none-elf |
| 21 | + - riscv64gc-unknown-none-elf |
| 22 | + include: |
| 23 | + # Nightly is only for reference and allowed to fail |
| 24 | + - toolchain: nightly |
| 25 | + experimental: true |
| 26 | + runs-on: ubuntu-latest |
| 27 | + continue-on-error: ${{ matrix.experimental || false }} |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - uses: dtolnay/rust-toolchain@master |
| 31 | + with: |
| 32 | + toolchain: ${{ matrix.toolchain }} |
| 33 | + targets: ${{ matrix.target }} |
| 34 | + - name: Build |
| 35 | + run: cargo build --package riscv-pac --target ${{ matrix.target }} |
| 36 | + |
| 37 | + # On MacOS, Ubuntu, and Windows, we run the tests. |
| 38 | + test-others: |
| 39 | + strategy: |
| 40 | + matrix: |
| 41 | + os: |
| 42 | + - macos-latest |
| 43 | + - ubuntu-latest |
| 44 | + - windows-latest |
| 45 | + runs-on: ${{ matrix.os }} |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + - uses: dtolnay/rust-toolchain@stable |
| 49 | + - name: Run tests |
| 50 | + run: cargo test --package riscv-pac |
| 51 | + |
| 52 | + # Job to check that all the builds succeeded |
| 53 | + build-check: |
| 54 | + needs: |
| 55 | + - build-riscv |
| 56 | + - test-others |
| 57 | + runs-on: ubuntu-latest |
| 58 | + if: always() |
| 59 | + steps: |
| 60 | + - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
0 commit comments