Skip to content

Commit

Permalink
add project env to agdb workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvlach committed Jan 1, 2024
1 parent f935143 commit 89f0a59
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/agdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches: ["main"]

env:
PROJECT: agdb

jobs:
diff:
runs-on: ubuntu-latest
Expand All @@ -16,15 +19,15 @@ jobs:
- id: diff
shell: bash
run: |
if [[ "$(git diff origin/main --name-only -- agdb/ agdb_derive/ .github/workflows/agdb.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
if [[ "$(git diff origin/main --name-only -- ${{ env.PROJECT }}/ agdb_derive/ .github/workflows/${{ env.PROJECT }}.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
agdb_analyse:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- run: cargo clippy --package agdb --package agdb_derive --all-targets --all-features -- -D warnings
- run: cargo clippy --package ${{ env.PROJECT }} --package agdb_derive --all-targets --all-features -- -D warnings

agdb_coverage:
runs-on: ubuntu-latest
Expand All @@ -34,12 +37,12 @@ jobs:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@cargo-llvm-cov
- run: rustup component add llvm-tools-preview
- run: cargo llvm-cov --package agdb --package agdb_derive --all-features --ignore-filename-regex "agdb_derive" --fail-uncovered-functions 0 --fail-uncovered-lines 0 --show-missing-lines
- run: cargo llvm-cov --package ${{ env.PROJECT }} --package agdb_derive --all-features --ignore-filename-regex "agdb_derive" --fail-uncovered-functions 0 --fail-uncovered-lines 0 --show-missing-lines

agdb_format:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- run: cargo fmt --package agdb --package agdb_derive --check
- run: cargo fmt --package ${{ env.PROJECT }} --package agdb_derive --check

0 comments on commit 89f0a59

Please sign in to comment.