ci.yaml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. on:
  2. push:
  3. branches: [ staging, trying, master ]
  4. pull_request:
  5. name: Continuous integration
  6. env:
  7. CARGO_TERM_COLOR: always
  8. jobs:
  9. # On Linux, we check that the crate builds and links for all the toolchains and targets.
  10. ci-linux:
  11. strategy:
  12. matrix:
  13. # All generated code should be running on stable now, MRSV is 1.59.0
  14. toolchain: [ stable, nightly, 1.59.0 ]
  15. target:
  16. - x86_64-unknown-linux-gnu
  17. - riscv32i-unknown-none-elf
  18. - riscv32imc-unknown-none-elf
  19. - riscv32imac-unknown-none-elf
  20. - riscv64gc-unknown-linux-gnu
  21. - riscv64gc-unknown-none-elf
  22. cargo_flags: [ "--no-default-features", "--all-features" ]
  23. include:
  24. # Nightly is only for reference and allowed to fail
  25. - rust: nightly
  26. experimental: true
  27. runs-on: ubuntu-latest
  28. continue-on-error: ${{ matrix.experimental || false }}
  29. steps:
  30. - uses: actions/checkout@v3
  31. - uses: dtolnay/rust-toolchain@master
  32. with:
  33. toolchain: ${{ matrix.toolchain }}
  34. targets: ${{ matrix.target }}
  35. - name: Build library
  36. run: cargo build --target ${{ matrix.target }} ${{ matrix.cargo_flags }}
  37. # On macOS and Windows, we at least make sure that the crate builds and links.
  38. ci-others:
  39. strategy:
  40. matrix:
  41. os:
  42. - macOS-latest
  43. - windows-latest
  44. cargo_flags: [ "--no-default-features", "--all-features" ]
  45. runs-on: ${{ matrix.os }}
  46. steps:
  47. - uses: actions/checkout@v3
  48. - uses: dtolnay/rust-toolchain@stable
  49. - name: Build crate for host OS
  50. run: cargo build ${{ matrix.cargo_flags }}