|
| 1 | +name: CI |
| 2 | +on: [pull_request, merge_group] |
| 3 | + |
| 4 | +permissions: |
| 5 | + contents: read |
| 6 | + |
| 7 | +jobs: |
| 8 | + fmt: |
| 9 | + name: Cargo fmt |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + - uses: dtolnay/rust-toolchain@nightly |
| 14 | + with: |
| 15 | + components: rustfmt |
| 16 | + - uses: Swatinem/rust-cache@v2 |
| 17 | + - run: cargo fmt --all -- --check |
| 18 | + |
| 19 | + clippy: |
| 20 | + name: Cargo clippy |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + - uses: dtolnay/rust-toolchain@stable |
| 25 | + - uses: Swatinem/rust-cache@v2 |
| 26 | + - name: Run clippy check |
| 27 | + run: cargo clippy --all-targets --all-features -- -D warnings |
| 28 | + env: |
| 29 | + RUSTFLAGS: "--cfg tokio_unstable" |
| 30 | + |
| 31 | + build: |
| 32 | + name: Build (${{ matrix.toolchain }}) |
| 33 | + runs-on: ubuntu-latest |
| 34 | + strategy: |
| 35 | + matrix: |
| 36 | + toolchain: [stable, nightly] |
| 37 | + env: |
| 38 | + RUST_BACKTRACE: 1 |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + - uses: ./.github/actions/rust-build |
| 42 | + with: |
| 43 | + toolchain: ${{ matrix.toolchain }} |
| 44 | + |
| 45 | + check-docs: |
| 46 | + name: Check docs.rs |
| 47 | + runs-on: ubuntu-latest |
| 48 | + if: ${{ !startsWith(github.head_ref, 'release-') && !startsWith(github.ref_name, 'release-') }} |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + - uses: dtolnay/rust-toolchain@nightly |
| 52 | + with: |
| 53 | + components: rust-docs |
| 54 | + - uses: Swatinem/rust-cache@v2 |
| 55 | + - run: sudo apt-get update && sudo apt-get install -y jq |
| 56 | + - run: cargo install cargo-docs-rs |
| 57 | + - run: ./scripts/check-docsrs.sh |
| 58 | + |
| 59 | + trace-integrity: |
| 60 | + name: Trace Integrity & Analysis |
| 61 | + runs-on: ubuntu-latest |
| 62 | + services: |
| 63 | + dynamodb-local: |
| 64 | + image: amazon/dynamodb-local |
| 65 | + ports: |
| 66 | + - 8000:8000 |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + - uses: dtolnay/rust-toolchain@stable |
| 70 | + - uses: Swatinem/rust-cache@v2 |
| 71 | + - uses: actions/setup-node@v4 |
| 72 | + with: |
| 73 | + node-version: 24 |
| 74 | + - name: Enable perf_event_open and kallsyms for tests |
| 75 | + run: | |
| 76 | + sudo sysctl kernel.perf_event_paranoid=1 |
| 77 | + sudo sysctl kernel.kptr_restrict=0 |
| 78 | + - run: scripts/e2e-trace-tests.sh |
| 79 | + |
| 80 | + ci-pass: |
| 81 | + name: CI Pass |
| 82 | + runs-on: ubuntu-latest |
| 83 | + needs: [fmt, clippy, build, check-docs, trace-integrity] |
| 84 | + if: always() |
| 85 | + steps: |
| 86 | + - run: | |
| 87 | + if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then |
| 88 | + echo "One or more required jobs failed or were cancelled" |
| 89 | + exit 1 |
| 90 | + fi |
0 commit comments