diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ca1755d..4ee0f12 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,14 +8,12 @@ concurrency: cancel-in-progress: true jobs: - lint: - name: Lint + check: + name: Check runs-on: ubuntu-latest steps: - - name: Check out code into the Go module directory + - name: Checkout uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Install nix uses: DeterminateSystems/nix-installer-action@main @@ -26,40 +24,33 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- + - name: Cache Cargo artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-check + restore-keys: | + cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}- + cargo-${{ runner.os }}- + - name: Check formatting run: nix develop -c cargo fmt --check - name: Clippy run: nix develop -c cargo clippy - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Install nix - uses: DeterminateSystems/nix-installer-action@main - - - name: Setup Nix cache - uses: nix-community/cache-nix-action@main - with: - primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} - restore-prefixes-first-match: nix-${{ runner.os }}- - - name: Run tests - run: | - nix develop --command cargo test -- --show-output + run: nix develop -c cargo test -- --show-output deploy: name: Deploy runs-on: ubuntu-latest needs: - - lint - - test + - check steps: - name: Checkout uses: actions/checkout@v6 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6475eff..6fa4f44 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -8,14 +8,12 @@ concurrency: cancel-in-progress: true jobs: - lint: - name: Lint + check: + name: Check runs-on: ubuntu-latest steps: - - name: Check out code into the Go module directory + - name: Checkout uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Install nix uses: DeterminateSystems/nix-installer-action@main @@ -26,42 +24,34 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- + - name: Cache Cargo artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-check + restore-keys: | + cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}- + cargo-${{ runner.os }}- + - name: Check formatting run: nix develop -c cargo fmt --check - - name: Run clippy + - name: Clippy run: nix develop -c cargo clippy - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Install nix - uses: DeterminateSystems/nix-installer-action@main - - - name: Setup Nix cache - uses: nix-community/cache-nix-action@main - with: - primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} - restore-prefixes-first-match: nix-${{ runner.os }}- - - name: Run tests - run: | - nix develop --command cargo test -- --show-output + run: nix develop -c cargo test -- --show-output e2e: name: E2E Tests runs-on: ubuntu-latest steps: - - name: Check out code + - name: Checkout uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Install nix uses: DeterminateSystems/nix-installer-action@main @@ -72,6 +62,18 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- + - name: Cache Cargo artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-e2e + restore-keys: | + cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}- + cargo-${{ runner.os }}- + - name: Run E2E tests - run: | - nix develop -c cargo test --features e2e --test e2e -- --show-output + run: nix develop -c cargo test --features e2e --test e2e -- --show-output