| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | pull_request: |
| 6 | |
| 7 | env: |
| 8 | CARGO_TERM_COLOR: always |
| 9 | |
| 10 | jobs: |
| 11 | test-matrix: |
| 12 | runs-on: ${{ matrix.os }} |
| 13 | strategy: |
| 14 | fail-fast: false |
| 15 | matrix: |
| 16 | os: [ubuntu-22.04, windows-latest, macos-latest] |
| 17 | steps: |
| 18 | - uses: actions/checkout@v4 |
| 19 | |
| 20 | - name: Install Rust |
| 21 | run: | |
| 22 | rustup default 1.69.0 |
| 23 | rustup component add clippy |
| 24 | |
| 25 | - name: Test |
| 26 | run: | |
| 27 | cargo test |
| 28 | |
| 29 | - name: Clippy |
| 30 | run: | |
| 31 | cargo clippy --all-targets --all-features -- -D warnings |
| 32 | |
| 33 | - name: Build and run examples |
| 34 | run: | |
| 35 | cargo build --examples |
| 36 | cargo run --example print_libc |
| 37 | |
| 38 | musl-build: |
| 39 | runs-on: ubuntu-22.04 |
| 40 | needs: test-matrix |
| 41 | steps: |
| 42 | - uses: actions/checkout@v4 |
| 43 | |
| 44 | - name: Install Rust and musl target |
| 45 | run: | |
| 46 | rustup default 1.69.0 |
| 47 | rustup target add x86_64-unknown-linux-musl |
| 48 | |
| 49 | - name: Install musl toolchain |
| 50 | run: | |
| 51 | sudo apt-get update |
| 52 | sudo apt-get install -y musl-tools |
| 53 | |
| 54 | - name: Build tests for musl |
| 55 | run: | |
| 56 | cargo test --target x86_64-unknown-linux-musl |