Skip to content

Commit

Permalink
ci: Add integration tests for s3 (#1513)
Browse files Browse the repository at this point in the history
* ci: Add integration tests for s3

Signed-off-by: Xuanwo <github@xuanwo.io>
  • Loading branch information
Xuanwo authored Dec 28, 2022
1 parent d5f805f commit a2bcd29
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,74 @@ jobs:
/home/runner/.cargo/bin/sccache --show-stats
/home/runner/.cargo/bin/sccache --show-stats | grep -e "Cache hits\s*[1-9]"
s3_minio:
runs-on: ubuntu-latest
needs: build

# Setup minio server
services:
minio:
image: wktk/minio-server
ports:
- 9000:9000
env:
MINIO_ACCESS_KEY: "minioadmin"
MINIO_SECRET_KEY: "minioadmin"

steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Setup test bucket
env:
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"
AWS_EC2_METADATA_DISABLED: "true"
run: aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test

- name: Install rust
uses: ./.github/actions/rust-toolchain
with:
toolchain: "stable"

- uses: actions/download-artifact@v3
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x /home/runner/.cargo/bin/sccache

- name: Test
run: cargo clean && cargo build
env:
RUST_BACKTRACE: full
RUST_LOG: debug
RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache
SCCACHE_BUCKET: test
SCCACHE_ENDPOINT: http://127.0.0.1:9000/
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"

- name: Output
run: |
/home/runner/.cargo/bin/sccache --show-stats
/home/runner/.cargo/bin/sccache --show-stats | grep s3
- name: Test Twice for Cache Read
run: cargo clean && cargo build
env:
RUST_BACKTRACE: full
RUST_LOG: debug
RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache
SCCACHE_BUCKET: test
SCCACHE_ENDPOINT: http://127.0.0.1:9000/
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"

- name: Output
run: |
/home/runner/.cargo/bin/sccache --show-stats
/home/runner/.cargo/bin/sccache --show-stats | grep -e "Cache hits\s*[1-9]"

0 comments on commit a2bcd29

Please sign in to comment.