| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | pull_request: |
| 7 | workflow_dispatch: |
| 8 | merge_group: |
| 9 | types: [checks_requested] |
| 10 | |
| 11 | jobs: |
| 12 | linux-ci: |
| 13 | name: Linux |
| 14 | runs-on: ubuntu-latest |
| 15 | strategy: |
| 16 | matrix: |
| 17 | toolchain: |
| 18 | - nightly |
| 19 | - beta |
| 20 | - stable |
| 21 | - 1.63.0 |
| 22 | features: |
| 23 | - |
| 24 | - --features dummy_match_byte |
| 25 | - --features malloc_size_of |
| 26 | include: |
| 27 | - toolchain: nightly |
| 28 | features: --features bench |
| 29 | - toolchain: nightly |
| 30 | features: --features bench,dummy_match_byte |
| 31 | steps: |
| 32 | - uses: actions/checkout@v2 |
| 33 | |
| 34 | - name: Install toolchain |
| 35 | uses: actions-rs/toolchain@v1 |
| 36 | with: |
| 37 | profile: minimal |
| 38 | toolchain: ${{ matrix.toolchain }} |
| 39 | override: true |
| 40 | components: rustfmt, clippy, ${{ matrix.toolchain == 'nightly' && 'miri,rust-src' || '' }} |
| 41 | |
| 42 | - name: Cargo format & lint |
| 43 | run: cargo fmt --check && cargo clippy -- -Dwarnings |
| 44 | |
| 45 | - name: Cargo build |
| 46 | run: cargo build ${{ matrix.features }} |
| 47 | |
| 48 | - name: Cargo doc |
| 49 | run: cargo doc ${{ matrix.features }} |
| 50 | |
| 51 | - name: Cargo test |
| 52 | run: cargo test ${{ matrix.features }} |
| 53 | |
| 54 | - name: macros build |
| 55 | run: cargo build |
| 56 | working-directory: macros |
| 57 | |
| 58 | - name: Color build |
| 59 | run: cargo build |
| 60 | working-directory: color |
| 61 | |
| 62 | - name: Color test |
| 63 | run: cargo test |
| 64 | working-directory: color |
| 65 | |
| 66 | - name: Cargo miri test |
| 67 | if: "matrix.toolchain == 'nightly'" |
| 68 | run: cargo miri test --features skip_long_tests ${{ matrix.features }} |
| 69 | |
| 70 | build_result: |
| 71 | name: Result |
| 72 | runs-on: ubuntu-latest |
| 73 | needs: |
| 74 | - "linux-ci" |
| 75 | |
| 76 | steps: |
| 77 | - name: Mark the job as successful |
| 78 | run: exit 0 |
| 79 | if: success() |
| 80 | - name: Mark the job as unsuccessful |
| 81 | run: exit 1 |
| 82 | if: "!success()" |