ci: attempt to trigger test run only once #101
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: "Test Suite" | |
on: | |
push: | |
branches-ignore: | |
- 'dependabot/**' #avoid duplicates: only run the PR, not the push | |
- 'renovate/**' #avoid duplicates: only run the PR, not the push | |
- 'gh-pages' #github pages do not trigger all tests | |
tags-ignore: | |
- 'v*' #avoid rerun existing commit on release | |
pull_request: | |
branches: | |
- 'main' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/') || startsWith(github.head_ref, 'renovate/'))) | |
name: cargo test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
- name: Start minio | |
run: ./ci/minio_start.sh | |
- run: cargo test --all-features -- -Z unstable-options --format json --report-time | tee results.json | |
- name: Prepare junit report | |
id: cargo_reporter | |
uses: innoq/action-cargo-test-report@v1 | |
with: | |
cargo-test-report-json: 'results.json' | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: always() # always run even if the previous step fails | |
with: | |
check_name: Test Report | |
fail_on_failure: true | |
require_tests: true | |
annotate_only: true | |
summary: ${{ steps.cargo_reporter.outputs.summary }} | |
- name: Stop minio | |
run: ./ci/minio_stop.sh | |
# Check formatting with rustfmt | |
formatting: | |
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/') || startsWith(github.head_ref, 'renovate/'))) | |
name: cargo fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Ensure rustfmt is installed and setup problem matcher | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt | |
- name: Rustfmt Check | |
uses: actions-rust-lang/rustfmt@v1 | |
lint: | |
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/') || startsWith(github.head_ref, 'renovate/'))) | |
name: cargo clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: cargo clippy --all-features --all-targets --workspace -- -D warnings |