|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +env: |
| 11 | + CARGO_TERM_COLOR: always |
| 12 | + |
| 13 | +jobs: |
| 14 | + fmt: |
| 15 | + name: Rustfmt |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - uses: dtolnay/rust-action@nightly |
| 20 | + with: |
| 21 | + components: rustfmt |
| 22 | + - name: Check formatting |
| 23 | + run: cargo fmt --all -- --check |
| 24 | + |
| 25 | + clippy: |
| 26 | + name: Clippy |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - uses: dtolnay/rust-action@stable |
| 31 | + with: |
| 32 | + components: clippy |
| 33 | + - name: Clippy |
| 34 | + run: cargo clippy --all-targets --all-features -- -D warnings |
| 35 | + |
| 36 | + test: |
| 37 | + name: Test (${{ matrix.os }}) |
| 38 | + runs-on: ${{ matrix.os }} |
| 39 | + strategy: |
| 40 | + fail-fast: false |
| 41 | + matrix: |
| 42 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + - uses: dtolnay/rust-action@stable |
| 46 | + - name: Run tests |
| 47 | + run: cargo test --all-features --workspace |
| 48 | + |
| 49 | + docs: |
| 50 | + name: Docs |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + - uses: dtolnay/rust-action@stable |
| 55 | + - name: Check documentation |
| 56 | + env: |
| 57 | + RUSTDOCFLAGS: -D warnings |
| 58 | + run: cargo doc --no-deps --all-features --workspace |
| 59 | + |
| 60 | + conformance: |
| 61 | + name: Sigstore Conformance |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v4 |
| 65 | + |
| 66 | + - uses: dtolnay/rust-action@stable |
| 67 | + |
| 68 | + - name: Build conformance binary |
| 69 | + run: cargo build --release --example conformance --package sigstore-verify |
| 70 | + |
| 71 | + - name: Clone sigstore-conformance |
| 72 | + run: | |
| 73 | + git clone --depth 1 https://github.com/sigstore/sigstore-conformance.git |
| 74 | + cd sigstore-conformance |
| 75 | + pip install . |
| 76 | +
|
| 77 | + - name: Run sigstore-conformance |
| 78 | + env: |
| 79 | + GHA_SIGSTORE_CONFORMANCE_XFAIL: "" |
| 80 | + run: | |
| 81 | + pytest sigstore-conformance/test \ |
| 82 | + --entrypoint ./target/release/examples/conformance \ |
| 83 | + --skip-signing \ |
| 84 | + -v |
| 85 | +
|
| 86 | + # Optional: Run full signing tests (requires OIDC token) |
| 87 | + conformance-signing: |
| 88 | + name: Sigstore Conformance (with signing) |
| 89 | + runs-on: ubuntu-latest |
| 90 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 91 | + permissions: |
| 92 | + id-token: write |
| 93 | + contents: read |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@v4 |
| 96 | + |
| 97 | + - uses: dtolnay/rust-action@stable |
| 98 | + |
| 99 | + - name: Build conformance binary |
| 100 | + run: cargo build --release --example conformance --package sigstore-verify |
| 101 | + |
| 102 | + - name: Clone sigstore-conformance |
| 103 | + run: | |
| 104 | + git clone --depth 1 https://github.com/sigstore/sigstore-conformance.git |
| 105 | + cd sigstore-conformance |
| 106 | + pip install . |
| 107 | +
|
| 108 | + - name: Run sigstore-conformance (with signing) |
| 109 | + env: |
| 110 | + GHA_SIGSTORE_CONFORMANCE_XFAIL: "" |
| 111 | + run: | |
| 112 | + pytest sigstore-conformance/test \ |
| 113 | + --entrypoint ./target/release/examples/conformance \ |
| 114 | + -v |
0 commit comments