| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [v1] |
| 6 | pull_request: |
| 7 | workflow_dispatch: |
| 8 | merge_group: |
| 9 | types: [checks_requested] |
| 10 | |
| 11 | jobs: |
| 12 | ci: |
| 13 | name: Build/Test |
| 14 | strategy: |
| 15 | matrix: |
| 16 | toolchain: ["stable", "beta", "nightly", "1.36.0"] |
| 17 | os: [ubuntu-latest] |
| 18 | include: |
| 19 | - toolchain: stable |
| 20 | fuzz: 0 |
| 21 | - toolchain: beta |
| 22 | fuzz: 0 |
| 23 | - os: windows-latest |
| 24 | toolchain: nightly |
| 25 | |
| 26 | runs-on: ${{ matrix.os }} |
| 27 | |
| 28 | steps: |
| 29 | - uses: actions/checkout@v4 |
| 30 | |
| 31 | - name: Install packages for fuzzing |
| 32 | if: runner.os == 'Linux' && matrix.fuzz == 1 |
| 33 | run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev |
| 34 | |
| 35 | - name: Install toolchain |
| 36 | uses: dtolnay/rust-toolchain@master |
| 37 | with: |
| 38 | toolchain: ${{ matrix.toolchain }} |
| 39 | |
| 40 | - name: Cargo build |
| 41 | run: cargo build --verbose |
| 42 | |
| 43 | - name: Cargo test |
| 44 | if: matrix.toolchain != '1.36.0' |
| 45 | run: cargo test --verbose |
| 46 | |
| 47 | - name: Cargo test w/ serde |
| 48 | if: matrix.toolchain != '1.36.0' |
| 49 | run: cargo test --verbose --features serde |
| 50 | |
| 51 | - name: Cargo test w/ malloc_size_of |
| 52 | if: matrix.toolchain != '1.36.0' |
| 53 | run: cargo test --verbose --features malloc_size_of |
| 54 | |
| 55 | - name: Cargo check w/o default features |
| 56 | if: matrix.toolchain == 'nightly' |
| 57 | run: cargo check --verbose --no-default-features |
| 58 | |
| 59 | - name: Cargo test w/ union |
| 60 | if: matrix.toolchain == 'beta' |
| 61 | run: cargo test --verbose --features union |
| 62 | |
| 63 | - name: Cargo test w/ debugger_visualizer |
| 64 | if: matrix.toolchain == 'nightly' |
| 65 | run: cargo test --test debugger_visualizer --verbose --features debugger_visualizer -- --test-threads=1 |
| 66 | |
| 67 | - name: Cargo test w/ debugger_visualizer and union |
| 68 | if: matrix.toolchain == 'nightly' |
| 69 | run: cargo test --test debugger_visualizer --verbose --features 'debugger_visualizer,union' -- --test-threads=1 |
| 70 | |
| 71 | - name: Cargo test all features |
| 72 | if: matrix.toolchain == 'nightly' |
| 73 | run: cargo test --verbose --all-features |
| 74 | |
| 75 | - name: Cargo bench |
| 76 | if: matrix.toolchain == 'nightly' |
| 77 | run: cargo bench --verbose bench |
| 78 | |
| 79 | - name: miri |
| 80 | if: matrix.toolchain == 'nightly' && matrix.os == 'ubuntu-latest' |
| 81 | run: bash ./scripts/run_miri.sh |
| 82 | |
| 83 | - name: fuzz |
| 84 | if: matrix.fuzz == 1 |
| 85 | working-directory: fuzz |
| 86 | run: ./travis-fuzz.sh |
| 87 | |
| 88 | no-std: |
| 89 | name: no_std |
| 90 | runs-on: ubuntu-latest |
| 91 | steps: |
| 92 | - uses: actions/checkout@v4 |
| 93 | - name: Install toolchain |
| 94 | uses: dtolnay/rust-toolchain@master |
| 95 | with: |
| 96 | toolchain: stable |
| 97 | target: thumbv7m-none-eabi |
| 98 | - name: Cargo build |
| 99 | run: cargo build --verbose |
| 100 | |
| 101 | build_result: |
| 102 | name: Result |
| 103 | runs-on: ubuntu-latest |
| 104 | needs: |
| 105 | - "ci" |
| 106 | - "no-std" |
| 107 | |
| 108 | steps: |
| 109 | - name: Mark the job as successful |
| 110 | run: exit 0 |
| 111 | if: success() |
| 112 | - name: Mark the job as unsuccessful |
| 113 | run: exit 1 |
| 114 | if: "!success()" |