4
0

build.yaml 2.1 KB

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