|
| 1 | +# GENERATED: this file is generated by https://github.com/facet-rs/facet-dev |
| 2 | + |
| 3 | +name: Tests |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [main] |
| 8 | + pull_request: |
| 9 | + branches: [main] |
| 10 | + merge_group: |
| 11 | + |
| 12 | +jobs: |
| 13 | + test: |
| 14 | + runs-on: depot-ubuntu-24.04-32 |
| 15 | + |
| 16 | + container: |
| 17 | + image: ghcr.io/facet-rs/facet-ci:latest-amd64 |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - uses: Swatinem/rust-cache@v2 |
| 22 | + |
| 23 | + - name: ✨ Run tests |
| 24 | + shell: bash |
| 25 | + run: | |
| 26 | + set -euo pipefail |
| 27 | +
|
| 28 | + echo "::group::All tests except doc-tests" |
| 29 | + cargo nextest run --all-features |
| 30 | + echo "::endgroup::" |
| 31 | +
|
| 32 | + echo "::group::Doc tests" |
| 33 | + output=$(cargo test --doc --all-features 2>&1) || exit_code=$? |
| 34 | + if [ "${exit_code:-0}" -ne 0 ]; then |
| 35 | + if [ $exit_code -eq 101 ] && echo "$output" | grep -q "no library targets found in package"; then |
| 36 | + echo "No library targets found, skipping doc tests" |
| 37 | + else |
| 38 | + echo "$output" |
| 39 | + exit $exit_code |
| 40 | + fi |
| 41 | + fi |
| 42 | + echo "::endgroup::" |
| 43 | +
|
| 44 | + msrv: |
| 45 | + runs-on: depot-ubuntu-24.04-32 |
| 46 | + |
| 47 | + container: |
| 48 | + image: ghcr.io/facet-rs/facet-ci:latest-amd64 |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - uses: Swatinem/rust-cache@v2 |
| 53 | + |
| 54 | + - uses: taiki-e/install-action@cargo-hack |
| 55 | + |
| 56 | + - name: ✨ Check MSRV |
| 57 | + shell: bash |
| 58 | + run: | |
| 59 | + set -euo pipefail |
| 60 | +
|
| 61 | + cargo hack check --each-feature --locked \ |
| 62 | + --rust-version --workspace \ |
| 63 | + --keep-going --exclude-no-default-features |
| 64 | +
|
| 65 | + minimal-versions: |
| 66 | + runs-on: depot-ubuntu-24.04-32 |
| 67 | + |
| 68 | + container: |
| 69 | + image: ghcr.io/facet-rs/facet-ci:latest-amd64 |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v4 |
| 72 | + |
| 73 | + - uses: Swatinem/rust-cache@v2 |
| 74 | + |
| 75 | + - name: ✨ Check minimal versions |
| 76 | + shell: bash |
| 77 | + run: | |
| 78 | + set -euo pipefail |
| 79 | +
|
| 80 | + # Install nightly for minimal-versions feature |
| 81 | + rustup toolchain install nightly |
| 82 | +
|
| 83 | + # Generate lockfile with minimal versions |
| 84 | + cargo +nightly generate-lockfile -Z minimal-versions |
| 85 | +
|
| 86 | + # Check with stable using minimal versions |
| 87 | + cargo check --workspace --all-features --locked --keep-going |
| 88 | +
|
| 89 | + docs: |
| 90 | + runs-on: depot-ubuntu-24.04-32 |
| 91 | + |
| 92 | + container: |
| 93 | + image: ghcr.io/facet-rs/facet-ci:latest-amd64 |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@v4 |
| 96 | + |
| 97 | + - uses: Swatinem/rust-cache@v2 |
| 98 | + |
| 99 | + - name: ✨ Check documentation |
| 100 | + shell: bash |
| 101 | + env: |
| 102 | + RUSTDOCFLAGS: -D warnings |
| 103 | + run: | |
| 104 | + set -euo pipefail |
| 105 | +
|
| 106 | + cargo doc --workspace --all-features --no-deps --document-private-items --keep-going |
| 107 | +
|
| 108 | + lockfile: |
| 109 | + runs-on: depot-ubuntu-24.04-4 |
| 110 | + |
| 111 | + container: |
| 112 | + image: ghcr.io/facet-rs/facet-ci:latest-amd64 |
| 113 | + steps: |
| 114 | + - uses: actions/checkout@v4 |
| 115 | + |
| 116 | + - uses: Swatinem/rust-cache@v2 |
| 117 | + |
| 118 | + - name: ✨ Check lockfile is updated |
| 119 | + shell: bash |
| 120 | + run: | |
| 121 | + cargo update --workspace --locked |
| 122 | +
|
| 123 | + clippy: |
| 124 | + runs-on: depot-ubuntu-24.04-16 |
| 125 | + |
| 126 | + container: |
| 127 | + image: ghcr.io/facet-rs/facet-ci:latest-amd64 |
| 128 | + permissions: |
| 129 | + security-events: write # to upload sarif results |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v4 |
| 132 | + |
| 133 | + - uses: Swatinem/rust-cache@v2 |
| 134 | + |
| 135 | + - name: Install SARIF tools |
| 136 | + shell: bash |
| 137 | + run: | |
| 138 | + cargo install clippy-sarif --locked |
| 139 | + cargo install sarif-fmt --locked |
| 140 | +
|
| 141 | + - name: ✨ Run clippy with SARIF output |
| 142 | + shell: bash |
| 143 | + run: | |
| 144 | + cargo clippy --workspace --all-features --all-targets --message-format=json | clippy-sarif | tee clippy-results.sarif | sarif-fmt |
| 145 | + continue-on-error: true |
| 146 | + |
| 147 | + - name: Upload SARIF results |
| 148 | + uses: github/codeql-action/upload-sarif@v3 |
| 149 | + with: |
| 150 | + sarif_file: clippy-results.sarif |
| 151 | + wait-for-processing: true |
| 152 | + |
| 153 | + - name: Report status |
| 154 | + shell: bash |
| 155 | + run: | |
| 156 | + cargo clippy --workspace --all-features --all-targets --keep-going -- -D warnings --allow deprecated |
0 commit comments