|
| 1 | +# This is the main CI workflow that runs the test suite on all pushes to main and all pull requests. |
| 2 | +# It runs the following jobs: |
| 3 | +# - required: runs the test suite on ubuntu with stable and beta rust toolchains |
| 4 | +# - minimal: runs the test suite with the minimal versions of the dependencies that satisfy the |
| 5 | +# requirements of this crate, and its dependencies |
| 6 | +# - os-check: runs the test suite on mac and windows |
| 7 | +# - coverage: runs the test suite and collects coverage information |
| 8 | +# See check.yml for information about how the concurrency cancelation and workflow triggering works |
1 | 9 | permissions:
|
2 | 10 | contents: read
|
3 | 11 | on:
|
4 | 12 | push:
|
5 | 13 | branches: [main]
|
6 | 14 | pull_request:
|
7 |
| -# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 |
8 | 15 | concurrency:
|
9 | 16 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
10 | 17 | cancel-in-progress: true
|
|
15 | 22 | name: ubuntu / ${{ matrix.toolchain }}
|
16 | 23 | strategy:
|
17 | 24 | matrix:
|
| 25 | + # run on stable and beta to ensure that tests won't break on the next version of the rust |
| 26 | + # toolchain |
18 | 27 | toolchain: [stable, beta]
|
19 | 28 | steps:
|
20 | 29 | - uses: actions/checkout@v4
|
|
25 | 34 | with:
|
26 | 35 | toolchain: ${{ matrix.toolchain }}
|
27 | 36 | - name: cargo generate-lockfile
|
| 37 | + # enable this ci template to run regardless of whether the lockfile is checked in or not |
28 | 38 | if: hashFiles('Cargo.lock') == ''
|
29 | 39 | run: cargo generate-lockfile
|
30 | 40 | # https://twitter.com/jonhoo/status/1571290371124260865
|
|
34 | 44 | - name: cargo test --doc
|
35 | 45 | run: cargo test --locked --all-features --doc
|
36 | 46 | minimal:
|
| 47 | + # This action chooses the oldest version of the dependencies permitted by Cargo.toml to ensure |
| 48 | + # that this crate is compatible with the minimal version that this crate and its dependencies |
| 49 | + # require. This will pickup issues where this create relies on functionality that was introduced |
| 50 | + # later than the actual version specified (e.g., when we choose just a major version, but a |
| 51 | + # method was added after this version). |
| 52 | + # |
| 53 | + # This particular check can be difficult to get to succeed as often transitive dependencies may |
| 54 | + # be incorrectly specified (e.g., a dependency specifies 1.0 but really requires 1.1.5). There |
| 55 | + # is an alternative flag available -Zminimal-direct that uses the minimal versions for direct |
| 56 | + # dependencies of this crate, while selecting the maximal versions for the transitive |
| 57 | + # dependencies. Alternatively, you can add a line in your Cargo.toml to artificially increase |
| 58 | + # the minimal dependency, which you do with e.g.: |
| 59 | + # ```toml |
| 60 | + # # for minimal-versions |
| 61 | + # [target.'cfg(any())'.dependencies] |
| 62 | + # openssl = { version = "0.10.55", optional = true } # needed to allow foo to build with -Zminimal-versions |
| 63 | + # ``` |
| 64 | + # The optional = true is necessary in case that dependency isn't otherwise transitively required |
| 65 | + # by your library, and the target bit is so that this dependency edge never actually affects |
| 66 | + # Cargo build order. See also |
| 67 | + # https://github.com/jonhoo/fantoccini/blob/fde336472b712bc7ebf5b4e772023a7ba71b2262/Cargo.toml#L47-L49. |
| 68 | + # This action is run on ubuntu with the stable toolchain, as it is not expected to fail |
37 | 69 | runs-on: ubuntu-latest
|
38 | 70 | name: ubuntu / stable / minimal-versions
|
39 | 71 | steps:
|
|
51 | 83 | - name: cargo test
|
52 | 84 | run: cargo test --locked --all-features --all-targets
|
53 | 85 | os-check:
|
| 86 | + # run cargo test on mac and windows |
54 | 87 | runs-on: ${{ matrix.os }}
|
55 | 88 | name: ${{ matrix.os }} / stable
|
56 | 89 | strategy:
|
|
75 | 108 | - name: cargo test
|
76 | 109 | run: cargo test --locked --all-features --all-targets
|
77 | 110 | coverage:
|
| 111 | + # use llvm-cov to build and collect coverage and outputs in a format that is compatible with |
| 112 | + # codecov.io |
78 | 113 | runs-on: ubuntu-latest
|
79 | 114 | name: ubuntu / stable / coverage
|
80 | 115 | steps:
|
|
0 commit comments