-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
7368c8b
commit 872571f
Showing
2 changed files
with
91 additions
and
57 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 |
---|---|---|
@@ -1,42 +1,100 @@ | ||
on: | ||
push: | ||
pull_request: | ||
merge_group: | ||
|
||
name: CI | ||
|
||
permissions: | ||
contents: read | ||
jobs: | ||
|
||
on: [pull_request, push] | ||
coverage: | ||
name: Test Suite | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Generate code coverage | ||
run: | | ||
cd auctioning_platform | ||
cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json | ||
- name: Upload coverage artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-ubuntu | ||
path: codecov.json | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.task.name }} (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
rust: [stable] | ||
task: | ||
- name: Check format | ||
run: cargo fmt -- --check | ||
allow_failure: false | ||
- name: Clippy | ||
run: cargo clippy | ||
allow_failure: true | ||
- name: Test | ||
run: cargo test --all | ||
allow_failure: false | ||
upload-coverage: | ||
name: Upload test coverage to CodeCov | ||
needs: [coverage] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
statuses: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust ${{ matrix.rust }} | ||
uses: actions-rs/toolchain@v1 | ||
- name: download coverage files | ||
uses: actions/download-artifact@v4 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
profile: minimal | ||
override: true | ||
components: rustfmt, clippy | ||
pattern: coverage-* | ||
|
||
- name: ${{ matrix.task.name }} | ||
run:| | ||
- name: display files | ||
run: | | ||
ls -aR | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
# directory: ./coverage | ||
# env_vars: OS,PYTHON | ||
fail_ci_if_error: false | ||
files: ./coverage-ubuntu/codecov.json | ||
# flags: unittests | ||
# name: codecov-umbrella | ||
verbose: true | ||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
- run: | | ||
cd auctioning_platform | ||
cargo fmt --check --all | ||
lint: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
- run: | | ||
cd auctioning_platform | ||
${{ matrix.task.run }} | ||
continue-on-error: ${{ matrix.task.allow_failure }} | ||
cargo clippy -- -D warnings | ||
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks | ||
check: | ||
if: always() | ||
needs: [lint, coverage, fmt] | ||
runs-on: ubuntu-latest | ||
permissions: {} | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
allowed-failures: lint |
This file was deleted.
Oops, something went wrong.