ci.yml 1.8 KB

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