fix: resolve GitHub Actions build failures and optimize cross-compila… #3
This file contains hidden or 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
| # Copyright 2024 RustFS Team | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Continuous Integration | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "**.txt" | |
| - "docs/**" | |
| - "deploy/**" | |
| - "scripts/dev_*.sh" | |
| - "scripts/probe.sh" | |
| - "LICENSE*" | |
| - ".gitignore" | |
| - ".dockerignore" | |
| - "README*" | |
| - "**/*.png" | |
| - "**/*.jpg" | |
| - "**/*.svg" | |
| - ".github/workflows/build.yml" | |
| - ".github/workflows/docker.yml" | |
| - ".github/workflows/audit.yml" | |
| - ".github/workflows/performance.yml" | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "**.txt" | |
| - "docs/**" | |
| - "deploy/**" | |
| - "scripts/dev_*.sh" | |
| - "scripts/probe.sh" | |
| - "LICENSE*" | |
| - ".gitignore" | |
| - ".dockerignore" | |
| - "README*" | |
| - "**/*.png" | |
| - "**/*.jpg" | |
| - "**/*.svg" | |
| - ".github/workflows/build.yml" | |
| - ".github/workflows/docker.yml" | |
| - ".github/workflows/audit.yml" | |
| - ".github/workflows/performance.yml" | |
| schedule: | |
| - cron: "0 0 * * 0" # Weekly on Sunday at midnight UTC | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| skip-check: | |
| name: Skip Duplicate Actions | |
| permissions: | |
| actions: write | |
| contents: read | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - name: Skip duplicate actions | |
| id: skip_check | |
| uses: fkirc/skip-duplicate-actions@v5 | |
| with: | |
| concurrent_skipping: "same_content_newer" | |
| cancel_others: true | |
| paths_ignore: '["*.md", "docs/**", "deploy/**"]' | |
| test-and-lint: | |
| name: Test and Lint | |
| needs: skip-check | |
| if: needs.skip-check.outputs.should_skip != 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust environment | |
| uses: ./.github/actions/setup | |
| with: | |
| rust-version: stable | |
| cache-shared-key: ci-test-${{ hashFiles('**/Cargo.lock') }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| cache-save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Run tests | |
| run: cargo test --all --exclude e2e_test | |
| - name: Check code formatting | |
| run: cargo fmt --all --check | |
| - name: Run clippy lints | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| e2e-tests: | |
| name: End-to-End Tests | |
| needs: skip-check | |
| if: needs.skip-check.outputs.should_skip != 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust environment | |
| uses: ./.github/actions/setup | |
| with: | |
| rust-version: stable | |
| cache-shared-key: ci-e2e-${{ hashFiles('**/Cargo.lock') }} | |
| cache-save-if: ${{ github.ref == 'refs/heads/main' }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install s3s-e2e test tool | |
| uses: taiki-e/cache-cargo-install-action@v2 | |
| with: | |
| tool: s3s-e2e | |
| git: https://github.com/Nugine/s3s.git | |
| rev: b7714bfaa17ddfa9b23ea01774a1e7bbdbfc2ca3 | |
| - name: Build debug binary | |
| run: | | |
| touch rustfs/build.rs | |
| cargo build -p rustfs --bins | |
| - name: Run end-to-end tests | |
| run: | | |
| s3s-e2e --version | |
| ./scripts/e2e-run.sh ./target/debug/rustfs /tmp/rustfs | |
| - name: Upload test logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-test-logs-${{ github.run_number }} | |
| path: /tmp/rustfs.log | |
| retention-days: 3 |