Skip to content

Commit

Permalink
rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mxfactorial committed Nov 10, 2023
1 parent 133215e commit d952da4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/dev-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
types:
- completed

env:
WORK_DIR: services/rule
RUST_PKG: rule
CONF_PATH: .services.rule

jobs:
test:
name: rule
Expand All @@ -22,21 +27,23 @@ jobs:
toolchain: stable
components: clippy, rustfmt
- uses: taiki-e/install-action@nextest
- name: linting
- name: ${{ env.WORK_DIR }} lint
run: |
cargo fmt -- --check
cargo clippy -- -Dwarnings
working-directory: services/rule
working-directory: ${{ env.WORK_DIR }}
- name: install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: services/rule unit tests
- name: ${{ env.WORK_DIR }} unit tests
run: cargo test
working-directory: services/rule
- name: services/rule coverage report
run: make rust-coverage RUST_PKG=rule
- name: fail services/rule coverage under 66%
working-directory: ${{ env.WORK_DIR }}
- name: ${{ env.WORK_DIR }} coverage report
run: |
make rust-coverage RUST_PKG=${{ env.RUST_PKG }}
echo "MIN_CODE_COV=$(yq ${{ env.CONF_PATH }}.min_code_cov project.yaml)" >> $GITHUB_ENV
- name: fail ${{ env.WORK_DIR }} coverage under ${{ env.MIN_CODE_COV }}%
run: |
if [[ $(make rust-coverage-percent RUST_PKG=rule) -lt 66 ]]; then
echo 'coverage dropped below 66%'
if [[ $(make rust-coverage-percent RUST_PKG=${{ env.RUST_PKG }}) -lt ${{ env.MIN_CODE_COV }} ]]; then
echo 'coverage dropped below ${{ env.MIN_CODE_COV }}%'
exit 1
fi
1 change: 1 addition & 0 deletions services/rule/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ mod tests {
.unwrap()
.0
.len();

// want length of approvals vec on tax transaction item to be 4 (started with 0)
let want_length: usize = 4;
assert_eq!(
Expand Down

0 comments on commit d952da4

Please sign in to comment.