-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
88 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Benchmark | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
Benchmark: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rust:latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Load cached dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Run benchmark | ||
run: cargo bench -- --output-format bencher > bench.txt | ||
- name: Load previous runs from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: cache/benchmarks | ||
key: benchmark-${{ runner.os }}-${{ github.run_id }} | ||
restore-keys: benchmark-${{ runner.os }} | ||
- name: Save benchmark | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
tool: 'cargo' | ||
output-file-path: bench.txt | ||
external-data-json-path: cache/benchmarks/benchmarks.json | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
save-data-file: ${{ github.event_name != 'pull_request' }} | ||
comment-always: true | ||
comment-on-alert: true | ||
fail-on-alert: false | ||
alert-threshold: '150%' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,44 @@ | ||
name: Build | ||
on: [push] | ||
permissions: | ||
contents: write | ||
jobs: | ||
Cleanup: | ||
CleanupAndTest: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rust:latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Add cargo features | ||
run: rustup component add rustfmt clippy | ||
- name: Clippy fix | ||
run: cargo clippy --all-features --all-targets --fix | ||
- name: Fmt | ||
run: cargo fmt | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: repo | ||
- name: Load cached dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: clippy | ||
- name: Fmt + clippy | ||
run: | | ||
cd repo | ||
cargo clippy --all-features --all-targets --fix | ||
cargo fmt | ||
- name: Toc | ||
run: | | ||
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc | ||
chmod a+x gh-md-toc | ||
./gh-md-toc --insert --no-backup --hide-footer --skip-header README.md | ||
./gh-md-toc --insert --no-backup --hide-footer --skip-header repo/README.md | ||
rm gh-md-toc | ||
- name: Apply cleanup | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: 'applying code formatting, lint fixes and toc creation' | ||
Build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: xd009642/tarpaulin:latest | ||
options: --security-opt seccomp=unconfined | ||
needs: Cleanup | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Add clippy | ||
run: rustup component add clippy | ||
cwd: repo | ||
- name: Fail build if clippy finds any error or warning | ||
run: cargo clippy --all-features --all-targets -- -D warnings | ||
- name: Generate code coverage | ||
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml | ||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
fail_ci_if_error: true | ||
run: | | ||
cd repo | ||
cargo clippy --all-features --all-targets -- -D warnings -D clippy::pedantic | ||
- name: Run test suite | ||
run: | | ||
cd repo | ||
cargo test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Codecov | ||
on: [push] | ||
permissions: | ||
contents: write | ||
jobs: | ||
Codecov: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: xd009642/tarpaulin:latest | ||
options: --security-opt seccomp=unconfined | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Load cached dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: tarpaulin | ||
- name: Generate code coverage | ||
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml | ||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: true |