add testcase for work with minio #64
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
concurrency: | |
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | |
cancel-in-progress: true | |
on: | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".github/ISSUE_TEMPLATE/**" | |
- ".github/pull_request_template.md" | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".github/ISSUE_TEMPLATE/**" | |
- ".github/pull_request_template.md" | |
# manual trigger | |
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | |
workflow_dispatch: | |
jobs: | |
# Check crate compiles | |
linux-build-lib: | |
name: cargo check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/checkout@v3 | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
# these represent dependencies downloaded by cargo | |
# and thus do not depend on the OS, arch nor rust version. | |
path: /github/home/.cargo | |
key: cargo-cache- | |
- name: Check workspace in debug mode | |
run: cargo check | |
# test the crate | |
linux-test: | |
name: cargo test (amd64) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: /github/home/.cargo | |
# this key equals the ones on `linux-build-lib` for re-use | |
key: cargo-cache- | |
- name: Run tests (excluding doctests) | |
run: cargo test --lib --tests --bins | |
- name: Verify Working Directory Clean | |
run: git diff --exit-code | |
linux-test-example: | |
name: cargo examples (amd64) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Run examples | |
run: | | |
cargo run --example retention | |
- name: Verify Working Directory Clean | |
run: git diff --exit-code | |
check-fmt: | |
name: Check cargo fmt | |
runs-on: ubuntu-latest | |
# container: | |
# image: amd64/rust | |
steps: | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/checkout@v3 | |
- name: Run | |
run: ci/scripts/rust_fmt.sh | |
cargo-toml-formatting-checks: | |
name: check Cargo.toml formatting | |
runs-on: ubuntu-latest | |
# container: | |
# image: amd64/rust | |
steps: | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: /github/home/.cargo | |
# this key equals the ones on `linux-build-lib` for re-use | |
key: cargo-cache- | |
- name: Install cargo-tomlfmt | |
run: which cargo-tomlfmt || cargo install cargo-tomlfmt | |
- name: Check Cargo.toml formatting | |
run: | | |
# if you encounter error, try rerun the command below, finally run 'git diff' to | |
# check which Cargo.toml introduces formatting violation | |
# | |
# ignore ./Cargo.toml because putting workspaces in multi-line lists make it easy to read | |
ci/scripts/rust_toml_fmt.sh | |
git diff --exit-code | |
clippy: | |
name: clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: /github/home/.cargo | |
# this key equals the ones on `linux-build-lib` for re-use | |
key: cargo-cache- | |
- name: Install Clippy | |
run: rustup component add clippy | |
- name: Run clippy | |
run: ci/scripts/rust_clippy.sh |