mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-25 21:46:50 +00:00
fix(ci): refactor ci check
This commit is contained in:
@@ -13,9 +13,9 @@ inputs:
|
|||||||
description: "Cache key for shared cache"
|
description: "Cache key for shared cache"
|
||||||
cache-save-if:
|
cache-save-if:
|
||||||
required: true
|
required: true
|
||||||
default: true
|
default: ${{ github.ref == 'refs/heads/main' }}
|
||||||
description: "Cache save condition"
|
description: "Cache save condition"
|
||||||
run-os:
|
runs-on:
|
||||||
required: true
|
required: true
|
||||||
default: "ubuntu-latest"
|
default: "ubuntu-latest"
|
||||||
description: "Running system"
|
description: "Running system"
|
||||||
@@ -24,7 +24,7 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
if: inputs.run-os == 'ubuntu-latest'
|
if: inputs.runs-on == 'ubuntu-latest'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -45,7 +45,6 @@ runs:
|
|||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
cache-on-failure: true
|
|
||||||
cache-all-crates: true
|
cache-all-crates: true
|
||||||
shared-key: ${{ inputs.cache-shared-key }}
|
shared-key: ${{ inputs.cache-shared-key }}
|
||||||
save-if: ${{ inputs.cache-save-if }}
|
save-if: ${{ inputs.cache-save-if }}
|
||||||
|
|||||||
+30
-84
@@ -11,9 +11,6 @@ on:
|
|||||||
- cron: '0 0 * * 0' # at midnight of each sunday
|
- cron: '0 0 * * 0' # at midnight of each sunday
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
skip-check:
|
skip-check:
|
||||||
permissions:
|
permissions:
|
||||||
@@ -30,103 +27,52 @@ jobs:
|
|||||||
cancel_others: true
|
cancel_others: true
|
||||||
paths_ignore: '["*.md"]'
|
paths_ignore: '["*.md"]'
|
||||||
|
|
||||||
# Quality checks for pull requests
|
develop:
|
||||||
pr-checks:
|
needs: skip-check
|
||||||
name: Pull Request Quality Checks
|
if: needs.skip-check.outputs.should_skip != 'true'
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: cargo test --all --exclude e2e_test
|
||||||
|
|
||||||
|
- name: Format
|
||||||
|
run: cargo fmt --all --check
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
|
s3s-e2e:
|
||||||
|
name: E2E (s3s-e2e)
|
||||||
|
needs: skip-check
|
||||||
|
if: needs.skip-check.outputs.should_skip != 'true'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v4.2.2
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
# - name: Format Check
|
- name: Install s3s-e2e
|
||||||
# run: cargo fmt --all --check
|
uses: taiki-e/cache-cargo-install-action@v2
|
||||||
|
|
||||||
- name: Lint Check
|
|
||||||
run: cargo check --all-targets
|
|
||||||
|
|
||||||
- name: Clippy Check
|
|
||||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
||||||
|
|
||||||
- name: Unit Tests
|
|
||||||
run: cargo test --all --exclude e2e_test
|
|
||||||
|
|
||||||
- name: Format Code
|
|
||||||
run: cargo fmt --all
|
|
||||||
|
|
||||||
s3s-e2e:
|
|
||||||
name: E2E (s3s-e2e)
|
|
||||||
needs:
|
|
||||||
- skip-check
|
|
||||||
- develop
|
|
||||||
if: needs.skip-check.outputs.should_skip != 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4.2.2
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
with:
|
||||||
cache-on-failure: true
|
tool: s3s-e2e
|
||||||
cache-all-crates: true
|
git: https://github.com/Nugine/s3s.git
|
||||||
|
rev: b7714bfaa17ddfa9b23ea01774a1e7bbdbfc2ca3
|
||||||
- name: Install system dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y musl-tools build-essential lld libdbus-1-dev libwayland-dev libwebkit2gtk-4.1-dev libxdo-dev
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: cargo test --all --exclude e2e_test
|
|
||||||
|
|
||||||
- name: Build debug
|
- name: Build debug
|
||||||
run: |
|
run: |
|
||||||
touch rustfs/build.rs
|
touch rustfs/build.rs
|
||||||
cargo build -p rustfs --bins
|
cargo build -p rustfs --bins
|
||||||
|
|
||||||
- name: Pack artifacts
|
|
||||||
run: |
|
|
||||||
mkdir -p ./target/artifacts
|
|
||||||
cp target/debug/rustfs ./target/artifacts/rustfs-debug
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: rustfs
|
|
||||||
path: ./target/artifacts/*
|
|
||||||
|
|
||||||
- name: Install s3s-e2e
|
|
||||||
run: |
|
|
||||||
cargo install s3s-e2e --git https://github.com/Nugine/s3s.git
|
|
||||||
s3s-e2e --version
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: rustfs
|
|
||||||
path: ./target/artifacts
|
|
||||||
|
|
||||||
- name: Run s3s-e2e
|
- name: Run s3s-e2e
|
||||||
timeout-minutes: 10
|
|
||||||
run: |
|
run: |
|
||||||
./scripts/e2e-run.sh ./target/artifacts/rustfs-debug /tmp/rustfs
|
s3s-e2e --version
|
||||||
|
./scripts/e2e-run.sh ./target/debug/rustfs /tmp/rustfs
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: s3s-e2e.logs
|
name: s3s-e2e.logs
|
||||||
path: /tmp/rustfs.log
|
path: /tmp/rustfs.log
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
develop:
|
|
||||||
needs: skip-check
|
|
||||||
if: needs.skip-check.outputs.should_skip != 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4.2.2
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Format
|
|
||||||
run: cargo fmt --all --check
|
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
run: cargo check --all-targets
|
|
||||||
|
|
||||||
- name: Clippy
|
|
||||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
||||||
|
|||||||
Reference in New Issue
Block a user