diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 67850a94..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build -on: [pull_request, merge_group] -permissions: - contents: read - -jobs: - build: - name: Build - runs-on: ubuntu-latest - strategy: - matrix: - toolchain: - - stable - - nightly - env: - RUST_BACKTRACE: 1 - steps: - - uses: actions/checkout@v4 - - name: Build - uses: ./.github/actions/rust-build - with: - toolchain: ${{ matrix.toolchain }} diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml deleted file mode 100644 index 8fae3f9b..00000000 --- a/.github/workflows/check-docs.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Check docs.rs - -on: - pull_request: - merge_group: - push: - branches: - - main - -jobs: - check-docs: - runs-on: ubuntu-latest - if: ${{ !startsWith(github.head_ref, 'release-') && !startsWith(github.ref_name, 'release-') }} - steps: - - uses: actions/checkout@v4 - - - uses: dtolnay/rust-toolchain@nightly - with: - components: rust-docs - - - uses: Swatinem/rust-cache@v2 - - - name: Install jq - run: sudo apt-get update && sudo apt-get install -y jq - - - name: Install cargo-docs-rs - run: cargo install cargo-docs-rs - - - name: Check docs.rs builds - run: ./scripts/check-docsrs.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..28a945de --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,90 @@ +name: CI +on: [pull_request, merge_group] + +permissions: + contents: read + +jobs: + fmt: + name: Cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - uses: Swatinem/rust-cache@v2 + - run: cargo fmt --all -- --check + + clippy: + name: Cargo clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Run clippy check + run: cargo clippy --all-targets --all-features -- -D warnings + env: + RUSTFLAGS: "--cfg tokio_unstable" + + build: + name: Build (${{ matrix.toolchain }}) + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: [stable, nightly] + env: + RUST_BACKTRACE: 1 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/rust-build + with: + toolchain: ${{ matrix.toolchain }} + + check-docs: + name: Check docs.rs + runs-on: ubuntu-latest + if: ${{ !startsWith(github.head_ref, 'release-') && !startsWith(github.ref_name, 'release-') }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rust-docs + - uses: Swatinem/rust-cache@v2 + - run: sudo apt-get update && sudo apt-get install -y jq + - run: cargo install cargo-docs-rs + - run: ./scripts/check-docsrs.sh + + trace-integrity: + name: Trace Integrity & Analysis + runs-on: ubuntu-latest + services: + dynamodb-local: + image: amazon/dynamodb-local + ports: + - 8000:8000 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: actions/setup-node@v4 + with: + node-version: 24 + - name: Enable perf_event_open and kallsyms for tests + run: | + sudo sysctl kernel.perf_event_paranoid=1 + sudo sysctl kernel.kptr_restrict=0 + - run: scripts/e2e-trace-tests.sh + + ci-pass: + name: CI Pass + runs-on: ubuntu-latest + needs: [fmt, clippy, build, check-docs, trace-integrity] + if: always() + steps: + - run: | + if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then + echo "One or more required jobs failed or were cancelled" + exit 1 + fi diff --git a/.github/workflows/e2e-trace-integrity-and-analysis.yml b/.github/workflows/e2e-trace-integrity-and-analysis.yml deleted file mode 100644 index d3a6bbf9..00000000 --- a/.github/workflows/e2e-trace-integrity-and-analysis.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Trace Integrity & Analysis -on: - pull_request: - -permissions: - contents: read - -jobs: - trace-integrity-and-analysis: - name: Trace Integrity & Analysis - runs-on: ubuntu-latest - services: - dynamodb-local: - image: amazon/dynamodb-local - ports: - - 8000:8000 - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - uses: actions/setup-node@v4 - with: - node-version: 24 - - name: Enable perf_event_open and kallsyms for tests - shell: bash - run: | - sudo sysctl kernel.perf_event_paranoid=1 - sudo sysctl kernel.kptr_restrict=0 - - name: E2E trace tests - run: scripts/e2e-trace-tests.sh diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index e67e870a..00000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Formatting and Linting -on: [pull_request, merge_group] - -jobs: - fmt: - name: Cargo fmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@nightly - with: - components: rustfmt - - uses: Swatinem/rust-cache@v2 - - name: Run fmt check - shell: bash - run: cargo fmt --all -- --check - clippy: - name: Cargo clippy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Run clippy check - shell: bash - env: - RUSTFLAGS: "--cfg tokio_unstable" - run: cargo clippy --all-targets --all-features -- -D warnings