|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: [main] |
| 4 | + pull_request: |
| 5 | +name: test |
| 6 | +jobs: |
| 7 | + required: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + name: ubuntu / ${{ matrix.toolchain }} |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + toolchain: [stable, beta] |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v3 |
| 15 | + with: |
| 16 | + submodules: true |
| 17 | + - name: Install ${{ matrix.toolchain }} |
| 18 | + uses: actions-rs/toolchain@v1 |
| 19 | + with: |
| 20 | + profile: minimal |
| 21 | + toolchain: ${{ matrix.toolchain }} |
| 22 | + default: true |
| 23 | + - name: cargo generate-lockfile |
| 24 | + if: hashFiles('Cargo.lock') == '' |
| 25 | + uses: actions-rs/cargo@v1 |
| 26 | + with: |
| 27 | + command: generate-lockfile |
| 28 | + # https://twitter.com/jonhoo/status/1571290371124260865 |
| 29 | + - name: cargo test --locked |
| 30 | + uses: actions-rs/cargo@v1 |
| 31 | + with: |
| 32 | + command: test |
| 33 | + args: --locked --all-features --all-targets |
| 34 | + minimal: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + name: ubuntu / stable / minimal-versions |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v3 |
| 39 | + with: |
| 40 | + submodules: true |
| 41 | + - name: Install stable |
| 42 | + uses: actions-rs/toolchain@v1 |
| 43 | + with: |
| 44 | + profile: minimal |
| 45 | + toolchain: stable |
| 46 | + - name: Install nightly for -Zminimal-versions |
| 47 | + uses: actions-rs/toolchain@v1 |
| 48 | + with: |
| 49 | + profile: minimal |
| 50 | + toolchain: nightly |
| 51 | + - name: cargo update -Zminimal-versions |
| 52 | + uses: actions-rs/cargo@v1 |
| 53 | + with: |
| 54 | + command: update |
| 55 | + toolchain: nightly |
| 56 | + args: -Zminimal-versions |
| 57 | + - name: cargo test |
| 58 | + uses: actions-rs/cargo@v1 |
| 59 | + with: |
| 60 | + command: test |
| 61 | + args: --locked --all-features --all-targets |
| 62 | + os-check: |
| 63 | + runs-on: ${{ matrix.os }} |
| 64 | + name: ${{ matrix.os }} / stable |
| 65 | + strategy: |
| 66 | + fail-fast: false |
| 67 | + matrix: |
| 68 | + os: [macos-latest, windows-latest] |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v3 |
| 71 | + with: |
| 72 | + submodules: true |
| 73 | + - name: Install stable |
| 74 | + uses: actions-rs/toolchain@v1 |
| 75 | + with: |
| 76 | + profile: minimal |
| 77 | + toolchain: stable |
| 78 | + - name: cargo generate-lockfile |
| 79 | + if: hashFiles('Cargo.lock') == '' |
| 80 | + uses: actions-rs/cargo@v1 |
| 81 | + with: |
| 82 | + command: generate-lockfile |
| 83 | + - name: cargo test |
| 84 | + uses: actions-rs/cargo@v1 |
| 85 | + with: |
| 86 | + command: test |
| 87 | + args: --locked --all-features --all-targets |
| 88 | + coverage: |
| 89 | + runs-on: ubuntu-latest |
| 90 | + name: ubuntu / stable / coverage |
| 91 | + steps: |
| 92 | + - uses: actions/checkout@v3 |
| 93 | + with: |
| 94 | + submodules: true |
| 95 | + - name: Install stable |
| 96 | + uses: actions-rs/toolchain@v1 |
| 97 | + with: |
| 98 | + profile: minimal |
| 99 | + toolchain: stable |
| 100 | + components: llvm-tools-preview |
| 101 | + - name: cargo install cargo-llvm-cov |
| 102 | + uses: taiki-e/install-action@cargo-llvm-cov |
| 103 | + - name: cargo generate-lockfile |
| 104 | + if: hashFiles('Cargo.lock') == '' |
| 105 | + uses: actions-rs/cargo@v1 |
| 106 | + with: |
| 107 | + command: generate-lockfile |
| 108 | + - name: cargo llvm-cov |
| 109 | + run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info |
| 110 | + - name: Upload to codecov.io |
| 111 | + uses: codecov/codecov-action@v3 |
| 112 | + with: |
| 113 | + fail_ci_if_error: true |
0 commit comments