ci.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: CI
  2. on: [push, pull_request]
  3. env:
  4. CARGO_TERM_COLOR: always
  5. jobs:
  6. test:
  7. strategy:
  8. matrix:
  9. target:
  10. - x86_64-unknown-linux-gnu
  11. - aarch64-unknown-linux-gnu
  12. - riscv64gc-unknown-linux-gnu
  13. build_std: [false]
  14. include:
  15. - target: riscv32gc-unknown-linux-gnu
  16. build_std: true
  17. runs-on: ubuntu-latest
  18. steps:
  19. - uses: actions/checkout@v3
  20. - name: Install Rust
  21. run: |
  22. rustup update nightly
  23. rustup default nightly
  24. - name: Install Rust standard library source
  25. if: matrix.build_std
  26. run: rustup component add rust-src
  27. - name: Install cross-compilation tools
  28. uses: taiki-e/setup-cross-toolchain-action@v1
  29. with:
  30. target: ${{ matrix.target }}
  31. - name: Build example binary
  32. if: '!matrix.build_std'
  33. run: cargo build --release
  34. - name: Build example binary
  35. if: matrix.build_std
  36. run: cargo build --release -Zbuild-std
  37. - name: Run example binary
  38. if: '!matrix.build_std'
  39. run: (cargo run --release 2>&1 | tee ../run.log) || true
  40. working-directory: example
  41. - name: Run example binary
  42. if: matrix.build_std
  43. run: (cargo run --release -Zbuild-std 2>&1 | tee ../run.log) || true
  44. working-directory: example
  45. - name: Check log
  46. run: |
  47. grep "panicked at 'panic', example/src/main.rs:36:5" run.log
  48. grep 'note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace' run.log
  49. grep 'dropped: "string"' run.log
  50. grep 'caught' run.log
  51. grep "panicked at 'panic', example/src/main.rs:46:5" run.log
  52. grep "panicked at 'panic on drop', example/src/main.rs:25:9" run.log
  53. grep "thread panicked while processing panic. aborting." run.log