Improve create-path performance backend #140
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
| --- | |
| name: Rust | |
| "on": | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Disable incremental compilation for CI (not reused). | |
| CARGO_INCREMENTAL: 0 | |
| # Disable debug info in dev builds (faster compile). | |
| CARGO_PROFILE_DEV_DEBUG: 0 | |
| PAR2_TURBO_VERSION: "1.4.0" | |
| PAR2_TURBO_CACHE_KEY: par2cmdline-turbo-1.4.0 | |
| PAR2_TURBO_SHA256: >- | |
| 0be495172b4b8aeabda39c493e47de652813fab88ae745c8633e901c05494281 | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "test" | |
| cache-on-failure: true | |
| - name: Cache par2cmdline | |
| id: cache-par2 | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/bin/par2 | |
| key: ${{ runner.os }}-${{ env.PAR2_TURBO_CACHE_KEY }} | |
| - name: Install par2cmdline-turbo | |
| if: steps.cache-par2.outputs.cache-hit != 'true' | |
| run: | | |
| archive="par2cmdline-turbo-${PAR2_TURBO_VERSION}-linux-amd64.zip" | |
| release_url="https://github.com/animetosho/par2cmdline-turbo" | |
| curl -fsSLO \ | |
| "${release_url}/releases/download/v${PAR2_TURBO_VERSION}/${archive}" | |
| echo "${PAR2_TURBO_SHA256} ${archive}" | sha256sum -c - | |
| python3 -m zipfile -e "${archive}" par2cmdline-turbo | |
| par2_bin="$(find par2cmdline-turbo -type f -name par2 -print -quit)" | |
| test -n "${par2_bin}" | |
| mkdir -p ~/bin | |
| install -m 0755 "${par2_bin}" ~/bin/par2 | |
| - name: Add par2 to PATH | |
| run: echo "$HOME/bin" >> $GITHUB_PATH | |
| - name: Check PAR2 reference tool | |
| run: par2 --version | |
| - name: Run tests | |
| run: cargo test --all-features --workspace | |
| cross-compile-aarch64: | |
| runs-on: ubuntu-latest | |
| name: Cross-compile for aarch64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: aarch64-unknown-linux-gnu | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "cross-compile-aarch64" | |
| cache-on-failure: true | |
| - name: Install cross | |
| run: cargo install cross --locked | |
| - name: Build library for aarch64 | |
| run: cross build --lib --target aarch64-unknown-linux-gnu | |
| - name: Build tests for aarch64 | |
| run: cross build --tests --target aarch64-unknown-linux-gnu | |
| - name: Verify aarch64 build | |
| run: | | |
| echo "✓ aarch64-unknown-linux-gnu build succeeded" | |
| echo " - Architecture separation validated" | |
| echo " - x86_64 backends: hasher_input, md5x2_scalar, md5x2_sse2, md5x2_bmi1, md5x2_avx512" | |
| echo " - aarch64 backends: md5x2_scalar, md5x2_neon, crc_armcrc" | |
| echo " - Shared: md5x2 trait" | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: llvm-tools-preview | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "coverage" | |
| cache-on-failure: true | |
| - name: Cache par2cmdline | |
| id: cache-par2-coverage | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/bin/par2 | |
| key: ${{ runner.os }}-${{ env.PAR2_TURBO_CACHE_KEY }} | |
| - name: Install par2cmdline-turbo | |
| if: steps.cache-par2-coverage.outputs.cache-hit != 'true' | |
| run: | | |
| archive="par2cmdline-turbo-${PAR2_TURBO_VERSION}-linux-amd64.zip" | |
| release_url="https://github.com/animetosho/par2cmdline-turbo" | |
| curl -fsSLO \ | |
| "${release_url}/releases/download/v${PAR2_TURBO_VERSION}/${archive}" | |
| echo "${PAR2_TURBO_SHA256} ${archive}" | sha256sum -c - | |
| python3 -m zipfile -e "${archive}" par2cmdline-turbo | |
| par2_bin="$(find par2cmdline-turbo -type f -name par2 -print -quit)" | |
| test -n "${par2_bin}" | |
| mkdir -p ~/bin | |
| install -m 0755 "${par2_bin}" ~/bin/par2 | |
| - name: Add par2 to PATH | |
| run: echo "$HOME/bin" >> $GITHUB_PATH | |
| - name: Check PAR2 reference tool | |
| run: par2 --version | |
| - name: Cache cargo-llvm-cov binary | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/bin/cargo-llvm-cov | |
| key: ${{ runner.os }}-cargo-llvm-cov-0.6.14 | |
| - name: Install cargo-llvm-cov | |
| run: | | |
| if ! command -v cargo-llvm-cov &> /dev/null; then | |
| cargo install cargo-llvm-cov --version 0.6.14 --locked | |
| fi | |
| - name: Generate coverage report | |
| run: ./scripts/coverage.sh ci | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: target/coverage/lcov.info | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Archive coverage results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: target/coverage |