62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- x86_64-unknown-linux-gnu
|
|
- i686-unknown-linux-gnu
|
|
- aarch64-unknown-linux-gnu
|
|
- riscv64gc-unknown-linux-gnu
|
|
build_std: [false]
|
|
include:
|
|
- target: riscv32gc-unknown-linux-gnu
|
|
build_std: true
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Rust
|
|
run: |
|
|
rustup update nightly
|
|
rustup default nightly
|
|
- name: Install Rust standard library source
|
|
if: matrix.build_std
|
|
run: rustup component add rust-src
|
|
- name: Install cross-compilation tools
|
|
uses: taiki-e/setup-cross-toolchain-action@v1
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Build example binary
|
|
if: '!matrix.build_std'
|
|
run: cargo build --release
|
|
- name: Build example binary
|
|
if: matrix.build_std
|
|
run: cargo build --release -Zbuild-std
|
|
|
|
- name: Run example binary
|
|
if: '!matrix.build_std'
|
|
run: (cargo run --release 2>&1 | tee ../run.log) || true
|
|
working-directory: example
|
|
- name: Run example binary
|
|
if: matrix.build_std
|
|
run: (cargo run --release -Zbuild-std 2>&1 | tee ../run.log) || true
|
|
working-directory: example
|
|
|
|
- name: Check log
|
|
run: |
|
|
grep "panicked at 'panic', example/src/main.rs:36:5" run.log
|
|
grep 'note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace' run.log
|
|
grep 'dropped: "string"' run.log
|
|
grep 'caught' run.log
|
|
grep "panicked at 'panic', example/src/main.rs:46:5" run.log
|
|
grep "panicked at 'panic on drop', example/src/main.rs:25:9" run.log
|
|
grep "thread panicked while processing panic. aborting." run.log
|