-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: improved CI and cleanup #254
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -D: deny anything that goes wrong within this lint | ||
# -W: warn the user what went wrong, but allow to build | ||
# -A: allow the user to do "incorrect" behaviour | ||
[build] | ||
rustflags = ["-D", "clippy::all", | ||
"-D", "clippy::pedantic", | ||
"-D", "clippy::correctness", | ||
"-D", "clippy::suspicious", | ||
"-D", "clippy::style", | ||
"-D", "clippy::complexity", | ||
"-D", "clippy::perf", | ||
"-D", "clippy::missing_docs_in_private_items", | ||
"-A", "clippy::only_used_in_recursion", | ||
"-A", "clippy::struct_excessive_bools", | ||
"-A", "clippy::module_name_repetitions"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
coverage: | ||
# Hold ourselves to a high bar | ||
range: 85..100 | ||
round: down | ||
precision: 1 | ||
status: | ||
# ref: https://docs.codecov.com/docs/commit-status | ||
project: | ||
default: | ||
# Avoid false negatives | ||
threshold: 1% | ||
|
||
# Test files aren't important for coverage | ||
ignore: | ||
- 'tests' | ||
|
||
# Make comments less noisy | ||
comment: | ||
layout: 'files' | ||
require_changes: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: cargo | ||
directory: / | ||
schedule: | ||
interval: daily | ||
ignore: | ||
- dependency-name: '*' | ||
# patch and minor updates don't matter for libraries | ||
update-types: | ||
- 'version-update:semver-patch' | ||
- 'version-update:semver-minor' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Check | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
name: Format | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
|
||
- name: Cache cargo resources | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: deps | ||
cache-on-failure: true | ||
|
||
- run: cargo fmt --all -- --check | ||
|
||
clippy: | ||
runs-on: ubuntu-latest | ||
name: Clippy | ||
permissions: | ||
contents: read | ||
checks: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
|
||
- name: Cache cargo resources | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: deps | ||
cache-on-failure: true | ||
|
||
- run: cargo clippy | ||
|
||
audit: | ||
runs-on: ubuntu-latest | ||
name: Audit | ||
permissions: | ||
contents: read | ||
checks: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Cache cargo resources | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: deps | ||
cache-on-failure: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
|
||
- run: cargo audit | ||
|
||
check: | ||
runs-on: ubuntu-latest | ||
name: Check | ||
permissions: | ||
contents: read | ||
checks: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Cache cargo resources | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: deps | ||
cache-on-failure: true | ||
|
||
- run: cargo check --workspace |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Coverage | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
name: Coverage | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: llvm-tools-preview | ||
- name: cargo install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: cargo generate-lockfile | ||
if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
- name: Cache cargo resources | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: deps | ||
cache-on-failure: true | ||
- name: Start acapy | ||
run: docker-compose -f ./docker/docker-compose.acapy.min.yml up -d | ||
- name: cargo llvm-cov clean | ||
run: cargo llvm-cov clean --workspace | ||
- name: cargo llvm-cov | ||
run: cargo llvm-cov --locked --all-features --no-report --release | ||
- name: cargo llvm-cov report | ||
run: cargo llvm-cov report --release --lcov --output-path lcov.info | ||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting that this doesn't fail w/o this flag provided There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uploading coverage can fail if their site or anything is down which might make it annoying. I would like to be strict here and only pass if everything works. Not opposed to removing it though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I see your reasoning. I meant more as in I would've thought initially that if error occurs it fail w/o having to explicitly set this |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Test | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy, rustfmt | ||
|
||
- name: Cache cargo resources | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: deps | ||
cache-on-failure: true | ||
|
||
- name: Tests | ||
run: cargo test --workspace --exclude=e2e-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why cahce the failed resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly taken this from a rust CI under Hyperlegder, but if we fetch 80% of deps and fail we still whould like to cache 80% of the deps. I actually will check later on if caching is setup properly inside the CI though.