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