chore: cargo update #58
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: ci | |
on: [push, pull_request] | |
env: | |
RUST_BACKTRACE: 1 | |
jobs: | |
style: | |
name: Check Style | |
# needless matrix to make copy-pasting common steps easier | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
rust: | |
- nightly | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust (${{ matrix.rust }}) | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
components: rustfmt | |
cache-shared-key: ${{ matrix.os }}-${{ matrix.rust }} | |
- name: Run Rustfmt | |
run: cargo fmt --all --check | |
check-and-test: | |
name: Run Clippy Checks and Tests | |
needs: [style] | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
rust: | |
- stable | |
- beta | |
- nightly | |
exclude: | |
# Windows builds depend on an unstable feature: windows_process_exit_code_from | |
# TODO: find a better way to handle this for windows without nightly | |
- os: windows-latest | |
rust: stable | |
- os: windows-latest | |
rust: beta | |
runs-on: ${{ matrix.os }} | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust (${{ matrix.rust }}) | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
components: clippy | |
cache-shared-key: ${{ matrix.os }}-${{ matrix.rust }} | |
- name: Fetch cargo dependencies | |
run: cargo fetch --verbose --locked | |
# Following commands use `--frozen` to ensure that the lockfile is up-to-date and | |
# all dependencies were downloaded with `cargo fetch`. | |
- name: Run Clippy (no default features) | |
run: cargo clippy --verbose --workspace --all-targets --no-default-features --frozen | |
- name: Run Clippy (default features) | |
run: cargo clippy --verbose --workspace --all-targets --frozen | |
- name: Run Clippy (all features) | |
run: cargo clippy --verbose --workspace --all-targets --all-features --frozen | |
- name: Run Tests (no default features) | |
run: cargo test --verbose --workspace --no-default-features --frozen | |
- name: Run Tests (default features) | |
run: cargo test --verbose --workspace --frozen | |
- name: Run Tests (all features) | |
run: cargo test --verbose --workspace --all-features --frozen | |
coverage: | |
name: Run tests with coverage | |
needs: [check-and-test] | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
rust: | |
- nightly | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust (${{ matrix.rust }}) | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
components: llvm-tools-preview | |
cache-shared-key: ${{ matrix.os }}-${{ matrix.rust }} | |
- name: Install grcov | |
run: cargo install grcov | |
- name: Run Rust tests with coverage | |
run: .github/scripts/collect-coverage.sh | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: target/debug/coverage/lcov | |
flags: unittests | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report-${{ matrix.rust }}-${{ matrix.os }} | |
path: target/debug/coverage/html/ | |
- name: Coveralls Parallel | |
uses: coverallsapp/github-action@v2 | |
with: | |
files: target/debug/coverage/lcov | |
build-docs: | |
name: Build Documentation | |
needs: [check-and-test] | |
# needless matrix to make copy-pasting common steps easier | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
rust: | |
- nightly | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust (${{ matrix.rust }}) | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
cache-shared-key: ${{ matrix.os }}-${{ matrix.rust }} | |
- name: Fetch cargo dependencies | |
run: cargo fetch --verbose --locked | |
- name: Build Documentation | |
run: cargo doc --verbose --workspace --document-private-items --frozen | |
- name: Print diagnostics | |
run: | | |
find ./target/doc -ls | |
du -hd1 ./target/doc | sort -h | |
- name: Upload Documentation as GitHub artifact | |
uses: actions/[email protected] | |
with: | |
name: docs | |
path: target/doc | |
compression-level: 9 | |
build-binaries: | |
name: Build Binaries | |
needs: [check-and-test] | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
rust: | |
- nightly | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust (${{ matrix.rust }}) | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
cache-shared-key: ${{ matrix.os }}-${{ matrix.rust }} | |
- name: Fetch cargo dependencies | |
run: cargo fetch --verbose --locked | |
- name: Build Binaries | |
run: cargo build --verbose --bins --workspace --frozen --profile=release-lto | |
- name: Print diagnostics | |
if: runner.os == 'Windows' | |
shell: powershell | |
run: | | |
Get-ChildItem -Path .\target\release-lto | |
- name: Print diagnostics | |
if: runner.os != 'Windows' | |
run: | | |
ls -Al ./target/release-lto | |
- name: Upload Binaries as GitHub artifact | |
uses: actions/[email protected] | |
with: | |
name: git-remote-codecommit-${{ matrix.os }} | |
path: | | |
target/release-lto/git-remote-codecommit | |
target/release-lto/git-remote-codecommit.exe | |
compression-level: 0 |