Skip to content

Commit

Permalink
ci: refactor cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Nugine committed Oct 21, 2024
1 parent f023432 commit 1dd683c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
name: "setup"
description: "setup environment for s3s"
inputs:
cache-shared-key:
description: "rust-cache shared-key"
required: false
default: ""
cache-save-if:
description: "rust-cache save-if"
required: false
default: true
runs:
using: "composite"
steps:
Expand All @@ -9,3 +18,6 @@ runs:
enable-cache: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ inputs.cache-shared-key }}
save-if: ${{ inputs.cache-save-if }}
34 changes: 27 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,32 @@ jobs:
- uses: taiki-e/install-action@cargo-audit
- run: cargo audit -D warnings

build-e2e:
needs: skip-check
if: needs.skip-check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
cache-shared-key: "e2e"
cache-save-if: true
- run: just install all

mint-proxy-minio:
name: e2e (mint, s3s-proxy, minio)
needs: skip-check
needs: [skip-check, build-e2e]
if: needs.skip-check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
cache-shared-key: "e2e"
cache-save-if: false
- run: just install all
- run: docker pull minio/mint:edge
- run: docker pull minio/minio:latest
- run: just install s3s-proxy
- run: ./scripts/e2e-mint.sh
- run: ./scripts/report-mint.py /tmp/mint/log.json
- uses: actions/upload-artifact@v4
Expand All @@ -106,14 +121,16 @@ jobs:

e2e-fs:
name: e2e (s3s-e2e, s3s-fs)
needs: skip-check
needs: [skip-check, build-e2e]
if: needs.skip-check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: just install s3s-e2e
- run: just install s3s-fs
with:
cache-shared-key: "e2e"
cache-save-if: false
- run: just install all
- run: ./scripts/e2e-fs.sh
- uses: actions/upload-artifact@v4
with:
Expand All @@ -122,12 +139,15 @@ jobs:

e2e-minio:
name: e2e (s3s-e2e, minio)
needs: skip-check
needs: [skip-check, build-e2e]
if: needs.skip-check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
cache-shared-key: "e2e"
cache-save-if: false
- run: just install all
- run: docker pull minio/minio:latest
- run: just install s3s-e2e
- run: ./scripts/e2e-minio.sh

0 comments on commit 1dd683c

Please sign in to comment.