Version 9 #1797
Workflow file for this run
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
on: | |
# Trigger the workflow on push to master or any pull request | |
# Ignore all tags | |
push: | |
branches: | |
- master | |
tags-ignore: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: "13 3 * * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
name: 🦀 Rust 🦀 | |
jobs: | |
rustfmt: | |
name: 📌 Formatting 📌 | |
runs-on: ubuntu-latest | |
steps: | |
- name: ✅ Checkout ✅ | |
uses: actions/checkout@v3 | |
- name: ⭕ Rustfmt Check ⭕ | |
run: cargo fmt --all -- --check | |
lints-linux: | |
name: 🕳️ Lints Linux 🕳️ | |
needs: rustfmt | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
rust: "1.70.0" | |
- os: ubuntu-latest | |
rust: stable | |
- os: ubuntu-latest | |
rust: beta | |
- os: ubuntu-latest | |
rust: nightly | |
steps: | |
- name: ✅ Checkout ✅ | |
uses: actions/checkout@v3 | |
- name: 💵 Cache 💵 | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
- name: 🧰 Toolchain 🧰 | |
run: | | |
rustup toolchain remove ${{ matrix.rust }} | |
rm -f ~/.cargo/bin/rustfmt | |
rm -f ~/.cargo/bin/cargo-fmt | |
rm -f ~/.cargo/bin/cargo-clippy | |
rustup toolchain install ${{ matrix.rust }} --profile default | |
rustup default ${{ matrix.rust }} | |
- name: 📎 Clippy 📎 | |
run: | | |
cargo update | |
cargo clippy -p test_util --all-targets -- -Dwarnings | |
cargo clippy -p vergen-lib --all-targets --features build,cargo,git,rustc,si -- -Dwarnings | |
cargo clippy -p vergen --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-gix --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-git2 --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-gitcl --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-pretty --all-targets --features color,header,trace -- -Dwarnings | |
lints-macos: | |
name: 🕳️ Lints MacOS 🕳️ | |
needs: rustfmt | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
rust: "1.70.0" | |
- os: macos-latest | |
rust: stable | |
- os: macos-latest | |
rust: beta | |
- os: macos-latest | |
rust: nightly | |
steps: | |
- name: ✅ Checkout ✅ | |
uses: actions/checkout@v3 | |
- name: 💵 Cache 💵 | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
- name: 🧰 Toolchain 🧰 | |
run: | | |
rustup toolchain remove ${{ matrix.rust }} | |
rustup toolchain install ${{ matrix.rust }} --profile default --no-self-update | |
rustup default ${{ matrix.rust }} | |
- name: 📎 Clippy 📎 | |
run: | | |
cargo update | |
cargo clippy -p test_util --all-targets -- -Dwarnings | |
cargo clippy -p vergen-lib --all-targets --features build,cargo,git,rustc,si -- -Dwarnings | |
cargo clippy -p vergen --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-gix --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-git2 --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-gitcl --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-pretty --all-targets --features color,header,trace -- -Dwarnings | |
lints-windows: | |
name: 🕳️ Lints Windows 🕳️ | |
needs: rustfmt | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
rust: "1.70.0" | |
- os: windows-latest | |
rust: stable | |
- os: windows-latest | |
rust: beta | |
- os: windows-latest | |
rust: nightly | |
steps: | |
- name: ✅ Checkout ✅ | |
uses: actions/checkout@v3 | |
- name: 💵 Cache 💵 | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
- name: 🧰 Toolchain 🧰 | |
run: | | |
rustup toolchain remove ${{ matrix.rust }} | |
rustup toolchain install ${{ matrix.rust }} --profile default --no-self-update | |
rustup default ${{ matrix.rust }} | |
- name: 📎 Clippy 📎 | |
run: | | |
cargo update | |
cargo clippy -p test_util --all-targets -- -Dwarnings | |
cargo clippy -p vergen-lib --all-targets --features build,cargo,git,rustc,si -- -Dwarnings | |
cargo clippy -p vergen --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-gix --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-git2 --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-gitcl --all-targets --features build,cargo,rustc,si -- -Dwarnings | |
cargo clippy -p vergen-pretty --all-targets --features color,header,trace -- -Dwarnings | |
test-linux: | |
name: 🧪 Linux 🧪 | |
needs: lints-linux | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
rust: "1.70.0" | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
rust: stable | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
rust: beta | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
rust: nightly | |
target: x86_64-unknown-linux-gnu | |
steps: | |
- name: ✅ Checkout ✅ | |
uses: actions/checkout@v3 | |
- name: 💵 Cache 💵 | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/coverage | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
- name: 🧰 Toolchain 🧰 | |
run: | | |
rustup toolchain remove ${{ matrix.rust }}-${{ matrix.target }} | |
rustup toolchain add ${{ matrix.rust }}-${{ matrix.target }} --profile minimal | |
rustup default ${{ matrix.rust }} | |
- name: 💾 Install (cargo-binstall) 💾 | |
uses: cargo-bins/cargo-binstall@main | |
- name: 💾 Install (tarpaulin, all-features) 💾 | |
continue-on-error: true | |
run: cargo binstall --no-confirm --no-symlinks cargo-tarpaulin cargo-all-features | |
- name: 🧪 Test 🧪 | |
run: | | |
cargo update | |
cargo test-all-features | |
cargo test -p vergen-pretty -F __vergen_test | |
cargo test -p vergen-pretty -F __vergen_test,color | |
cargo test -p vergen-pretty -F __vergen_test,trace | |
cargo test -p vergen-pretty -F __vergen_test,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,trace | |
cargo test -p vergen-pretty -F __vergen_test,trace,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,serde,trace | |
coverage: | |
name: 🧱 Code Coverage 🧱 | |
needs: test-linux | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
rust: "1.70.0" | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
rust: stable | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
rust: beta | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
rust: nightly | |
target: x86_64-unknown-linux-gnu | |
steps: | |
- name: ✅ Checkout ✅ | |
uses: actions/checkout@v3 | |
- name: 💵 Cache 💵 | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/coverage | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
- name: 🧰 Toolchain 🧰 | |
run: | | |
rustup toolchain remove ${{ matrix.rust }}-${{ matrix.target }} | |
rustup toolchain add ${{ matrix.rust }}-${{ matrix.target }} --profile minimal | |
rustup default ${{ matrix.rust }} | |
- name: 💾 Install (cargo-binstall) 💾 | |
uses: cargo-bins/cargo-binstall@main | |
- name: 💾 Install (llvm-cov) 💾 | |
continue-on-error: true | |
run: cargo binstall --no-confirm --no-symlinks cargo-llvm-cov | |
- name: 🙊 Clean Workspace 🙊 | |
run: cargo llvm-cov clean --workspace | |
- name: 🙊 Code Coverage (vergen-lib) 🙊 | |
run: cargo llvm-cov -p vergen-lib -F unstable,build,cargo,git,rustc,si --no-report | |
- name: 🙊 Code Coverage (vergen) 🙊 | |
run: cargo llvm-cov -p vergen -F unstable,build,cargo,rustc,si --no-report | |
- name: 🙊 Code Coverage (vergen-gix) 🙊 | |
run: cargo llvm-cov -p vergen-gix -F unstable,build,cargo,rustc,si --no-report | |
- name: 🙊 Code Coverage (vergen-git2) 🙊 | |
run: cargo llvm-cov -p vergen-git2 -F unstable,build,cargo,rustc,si --no-report | |
- name: 🙊 Code Coverage (vergen-gitcl) 🙊 | |
run: cargo llvm-cov -p vergen-gitcl -F unstable,build,cargo,rustc,si --no-report | |
- name: 🙊 Code Coverage (vergen-pretty) 🙊 | |
run: cargo llvm-cov -p vergen-pretty -F __vergen_test,color,header,serde,trace --no-report | |
- name: 🙊 Code Coverage Report 🙊 | |
run: cargo llvm-cov report -lcov --output-path lcov.info | |
- name: 🙊 Upload Code Coverage 🙊 | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./lcov.info | |
test-macos: | |
name: 🧪 MacOS 🧪 | |
needs: lints-macos | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
rust: "1.70.0" | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
rust: stable | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
rust: beta | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
rust: nightly | |
target: x86_64-apple-darwin | |
steps: | |
- name: ✅ Checkout ✅ | |
uses: actions/checkout@v3 | |
- name: 💵 Cache 💵 | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
- name: 🧰 Toolchain 🧰 | |
run: | | |
rustup toolchain remove ${{ matrix.rust }}-${{ matrix.target }} | |
rustup toolchain add ${{ matrix.rust }}-${{ matrix.target }} --profile minimal | |
rustup default ${{ matrix.rust }} | |
- name: 💾 Install (cargo-binstall) 💾 | |
uses: cargo-bins/cargo-binstall@main | |
- name: 💾 Install (all-features) 💾 | |
continue-on-error: true | |
run: cargo binstall --no-confirm --no-symlinks cargo-all-features | |
- name: 🧪 Test 🧪 | |
run: | | |
cargo update | |
cargo test-all-features | |
cargo test -p vergen-pretty -F __vergen_test | |
cargo test -p vergen-pretty -F __vergen_test,color | |
cargo test -p vergen-pretty -F __vergen_test,trace | |
cargo test -p vergen-pretty -F __vergen_test,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,trace | |
cargo test -p vergen-pretty -F __vergen_test,trace,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,serde,trace | |
test-windows: | |
name: 🧪 Windows 🧪 | |
needs: lints-windows | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
rust: "1.70.0" | |
target: x86_64-pc-windows-msvc | |
- os: windows-latest | |
rust: stable | |
target: x86_64-pc-windows-msvc | |
- os: windows-latest | |
rust: beta | |
target: x86_64-pc-windows-msvc | |
- os: windows-latest | |
rust: nightly | |
target: x86_64-pc-windows-msvc | |
- os: windows-latest | |
rust: "1.70.0" | |
target: x86_64-pc-windows-gnu | |
- os: windows-latest | |
rust: stable | |
target: x86_64-pc-windows-gnu | |
- os: windows-latest | |
rust: beta | |
target: x86_64-pc-windows-gnu | |
- os: windows-latest | |
rust: nightly | |
target: x86_64-pc-windows-gnu | |
steps: | |
- name: ✅ Checkout ✅ | |
uses: actions/checkout@v3 | |
- name: 💵 Cache 💵 | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock', '**/main.yml') }} | |
- name: 🧰 Toolchain 🧰 | |
run: | | |
rustup toolchain remove ${{ matrix.rust }}-${{ matrix.target }} | |
rustup toolchain add ${{ matrix.rust }}-${{ matrix.target }} --profile minimal --no-self-update | |
rustup default ${{ matrix.rust }} | |
- name: 💾 Install (cargo-binstall) 💾 | |
uses: cargo-bins/cargo-binstall@main | |
- name: 💾 Install (all-features) 💾 | |
continue-on-error: true | |
run: cargo binstall --no-confirm --no-symlinks cargo-all-features | |
- name: 🧪 Test 🧪 | |
run: | | |
cargo update | |
cargo test-all-features | |
cargo test -p vergen-pretty -F __vergen_test | |
cargo test -p vergen-pretty -F __vergen_test,color | |
cargo test -p vergen-pretty -F __vergen_test,trace | |
cargo test -p vergen-pretty -F __vergen_test,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,trace | |
cargo test -p vergen-pretty -F __vergen_test,trace,serde | |
cargo test -p vergen-pretty -F __vergen_test,color,serde,trace |