Skip to content

Commit

Permalink
Version 9 (#300)
Browse files Browse the repository at this point in the history
* version bump for next release

* Fixed lint from stable

* fix tarpaulin config

* fix tarpaulin run command

* work on vergen-gix tests

* fixed lint issue

* Some refactors to help with broken tests with default feature set

* Renamed repo_util to test_util

* Work on rustc implementation

* Added come test coverage

* sysinfo implementation

* Re-export vergen from vergen-gix

* Converted  vergen-pretty to use vergen-gix to test

* More test coverage

* vergen-git2 initial implementation

* Fix tarpaulin for vergen-git2

* Updated the tarpauling commands to be more concise

* removed tarpaulin.toml from vergen-lib

* test coverage for vergen-git2

* Fixed tarpaulin command for vergen-pretty

* Updated gix to latest, more coverage tweaks

* keys coverage

* Forgot to add vergen-lib cobertura.xml to upload

* vergen-gitcl implementaion

* Upload vergen-gitcl cobertura.xml

* Add CODECOV_TOKEN to see if fixes broken upload

* Lets try v4

* Back to v3

* Moved coverage to own job

* code coverage switch to llvm-cov

* rustfmt

* code coverage work

* Fix lints, fix broken windows test

* Fixed broken windows tests

* Removed tarpaulin references, fix report command

* Fixed unstable feature issue

* Code coverage work

* lint fix

* redundant clone in test

* More coverage work

* removed unused lint fix

* More coverage tweaks

* Fix keys test import for stable,beta

* Fixed keys when not using build,cargo feature

* Fixed vergen-pretty tests, updated keys coverage

* Fix to color feature test in vergen-pretty

* Update main.yml to include all coverage tasks

* More coverage

* Changed coverage output to get better reporting in codecov

* Update thresholds

* Updated github actions to latest versions

* Documentation, added support for custom instruction generation

* Some test for custom instruction generation

* Added empty tests for vergen-pretty

* vergen-lib docs

* vergen-pretty docs

* Fixed doc issue when color feature not enabled.

* docs, vergen-git2 tweaks

* vergen-gi* docs pass, tweaks to builder

* Fixed bug in vergen-pretty

* Workflow stuff

* Try pages update at end of coverage

* Changed if condition, removed cache wasn't working.

* comment out the pages stuff

* documentation, re-export AddCustomEntries, license files in each library

* added vergen-lib README.md

* tweaks to Cargo.toml

* prepare vergen-git2 for publish

* prepare vergen-gitcl for publish

* prepare vergen-gix for publish

* more README.md work

* more README.md work
  • Loading branch information
CraZySacX authored Jan 30, 2024
1 parent 375d671 commit c5b61b7
Show file tree
Hide file tree
Showing 80 changed files with 11,053 additions and 6,026 deletions.
8 changes: 8 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
# basic
target: 90%
threshold: 10%
if_ci_failed: error
222 changes: 117 additions & 105 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# permissions:
# contents: read
# pages: write
# id-token: write

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Expand All @@ -28,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ✅ Checkout ✅
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: ⭕ Rustfmt Check ⭕
run: cargo fmt --all -- --check
lints-linux:
Expand All @@ -48,17 +53,7 @@ jobs:
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') }}
uses: actions/checkout@v4
- name: 🧰 Toolchain 🧰
run: |
rustup toolchain remove ${{ matrix.rust }}
Expand All @@ -70,11 +65,13 @@ jobs:
- name: 📎 Clippy 📎
run: |
cargo update
cargo clippy -p vergen --all-targets --features build,cargo,git,gitcl,rustc,si -- -Dwarnings
cargo clippy -p vergen --all-targets --features build,cargo,git,git2,rustc,si -- -Dwarnings
cargo clippy -p vergen --all-targets --features build,cargo,git,gix,rustc,si -- -Dwarnings
cargo clippy -p vergen-pretty --all-targets --all-features -- -Dwarnings
cargo clippy -p repo_util --all-targets --all-features -- -Dwarnings
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
Expand All @@ -92,17 +89,7 @@ jobs:
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') }}
uses: actions/checkout@v4
- name: 🧰 Toolchain 🧰
run: |
rustup toolchain remove ${{ matrix.rust }}
Expand All @@ -111,11 +98,13 @@ jobs:
- name: 📎 Clippy 📎
run: |
cargo update
cargo clippy -p vergen --all-targets --features build,cargo,git,gitcl,rustc,si -- -Dwarnings
cargo clippy -p vergen --all-targets --features build,cargo,git,git2,rustc,si -- -Dwarnings
cargo clippy -p vergen --all-targets --features build,cargo,git,gix,rustc,si -- -Dwarnings
cargo clippy -p vergen-pretty --all-targets --all-features -- -Dwarnings
cargo clippy -p repo_util --all-targets --all-features -- -Dwarnings
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
Expand All @@ -133,17 +122,7 @@ jobs:
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') }}
uses: actions/checkout@v4
- name: 🧰 Toolchain 🧰
run: |
rustup toolchain remove ${{ matrix.rust }}
Expand All @@ -152,11 +131,13 @@ jobs:
- name: 📎 Clippy 📎
run: |
cargo update
cargo clippy -p vergen --all-targets --features build,cargo,git,gitcl,rustc,si -- -Dwarnings
cargo clippy -p vergen --all-targets --features build,cargo,git,git2,rustc,si -- -Dwarnings
cargo clippy -p vergen --all-targets --features build,cargo,git,gix,rustc,si -- -Dwarnings
cargo clippy -p vergen-pretty --all-targets --all-features -- -Dwarnings
cargo clippy -p repo_util --all-targets --all-features -- -Dwarnings
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
Expand All @@ -178,37 +159,21 @@ jobs:
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') }}
uses: actions/checkout@v4
- 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) 💾
- name: 💾 Install (all-features) 💾
continue-on-error: true
run: cargo binstall --no-confirm --no-symlinks cargo-tarpaulin cargo-all-features
run: cargo binstall --no-confirm --no-symlinks cargo-all-features
- name: 🧪 Test 🧪
run: |
cargo update
cargo test-all-features
cargo test -p vergen -F build,cargo,git,gitcl,rustc,si
cargo test -p vergen -F build,cargo,git,git2,rustc,si
cargo test -p vergen -F build,cargo,git,gix,rustc,si
cargo test -p vergen -F build,cargo,git,gitcl,git2,gitoxide,rustc,si
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
Expand All @@ -217,14 +182,91 @@ jobs:
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
- name: 🙊 Code Coverage (vergen) 🙊
run: cargo tarpaulin --config vergen/tarpaulin.toml --exclude-files vergen/src/lib.rs --exclude-files vergen-pretty/* --out xml --output-dir vergen --skip-clean --target-dir target/coverage
- name: 🙊 Code Coverage (vergen-pretty) 🙊
run: cargo tarpaulin --config vergen-pretty/tarpaulin.toml --exclude-files vergen-pretty/src/lib.rs --exclude-files vergen/* --out xml --output-dir vergen-pretty --skip-clean --target-dir target/coverage
coverage:
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
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@v4
- 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 - default) 🙊
run: cargo llvm-cov -p vergen-lib -F unstable --no-report
- name: 🙊 Code Coverage (vergen-lib - all) 🙊
run: cargo llvm-cov -p vergen-lib -F unstable,build,cargo,git,rustc,si --no-report
- name: 🙊 Code Coverage (vergen - default) 🙊
run: cargo llvm-cov -p vergen -F unstable --no-report
- name: 🙊 Code Coverage (vergen - all) 🙊
run: cargo llvm-cov -p vergen -F unstable,build,cargo,rustc,si --no-report
- name: 🙊 Code Coverage (vergen-gix - default) 🙊
run: cargo llvm-cov -p vergen-gix -F unstable --no-report
- name: 🙊 Code Coverage (vergen-gix - all) 🙊
run: cargo llvm-cov -p vergen-gix -F unstable,build,cargo,rustc,si --no-report
- name: 🙊 Code Coverage (vergen-git2 - default) 🙊
run: cargo llvm-cov -p vergen-git2 -F unstable --no-report
- name: 🙊 Code Coverage (vergen-git2 - all) 🙊
run: cargo llvm-cov -p vergen-git2 -F unstable,build,cargo,rustc,si --no-report
- name: 🙊 Code Coverage (vergen-gitcl - default) 🙊
run: cargo llvm-cov -p vergen-gitcl -F unstable --no-report
- name: 🙊 Code Coverage (vergen-gitcl - all) 🙊
run: cargo llvm-cov -p vergen-gitcl -F unstable,build,cargo,rustc,si --no-report
- name: 🙊 Code Coverage (vergen-pretty - default) 🙊
run: cargo llvm-cov -p vergen-pretty -F __vergen_test --no-report
- name: 🙊 Code Coverage (vergen-pretty - all) 🙊
run: cargo llvm-cov -p vergen-pretty -F __vergen_test,color,header,serde,trace --no-report
- name: 🙊 Code Coverage (vergen-pretty - empty default) 🙊
run: cargo llvm-cov -p vergen-pretty -F __vergen_empty_test --no-report
- name: 🙊 Code Coverage (vergen-pretty - empty all) 🙊
run: cargo llvm-cov -p vergen-pretty -F __vergen_empty_test,color,header,serde,trace --no-report
- name: 🙊 Code Coverage Report (LCOV) 🙊
run: cargo llvm-cov report --lcov --output-path lcov.info
- name: 🙊 Code Coverage Report (HTML) 🙊
run: cargo llvm-cov report --html
- name: 🙊 Upload Code Coverage 🙊
uses: codecov/codecov-action@v3
with:
files: ./vergen/cobertura.xml,./vergen-pretty/cobertura.xml
files: ./lcov.info
# - name: Setup Pages
# uses: actions/configure-pages@v4
# if: ${{ matrix.rust == 'nightly' }}
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v3
# if: ${{ matrix.rust == 'nightly' }}
# with:
# path: 'target/llvm-cov/html'
# - name: Deploy to GitHub Pages
# id: deployment
# if: ${{ matrix.rust == 'nightly' }}
# uses: actions/deploy-pages@v4
test-macos:
name: 🧪 MacOS 🧪
needs: lints-macos
Expand All @@ -246,18 +288,7 @@ jobs:
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') }}
uses: actions/checkout@v4
- name: 🧰 Toolchain 🧰
run: |
rustup toolchain remove ${{ matrix.rust }}-${{ matrix.target }}
Expand All @@ -272,10 +303,6 @@ jobs:
run: |
cargo update
cargo test-all-features
cargo test -p vergen -F build,cargo,git,gitcl,rustc,si
cargo test -p vergen -F build,cargo,git,git2,rustc,si
cargo test -p vergen -F build,cargo,git,gix,rustc,si
cargo test -p vergen -F build,cargo,git,gitcl,git2,gitoxide,rustc,si
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
Expand Down Expand Up @@ -317,18 +344,7 @@ jobs:
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') }}
uses: actions/checkout@v4
- name: 🧰 Toolchain 🧰
run: |
rustup toolchain remove ${{ matrix.rust }}-${{ matrix.target }}
Expand All @@ -343,10 +359,6 @@ jobs:
run: |
cargo update
cargo test-all-features
cargo test -p vergen -F build,cargo,git,gitcl,rustc,si
cargo test -p vergen -F build,cargo,git,git2,rustc,si
cargo test -p vergen -F build,cargo,git,gix,rustc,si
cargo test -p vergen -F build,cargo,git,gitcl,git2,gitoxide,rustc,si
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
Expand Down
Loading

0 comments on commit c5b61b7

Please sign in to comment.