Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvlach committed Jan 1, 2024
1 parent c945d45 commit f935143
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 20 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/agdb_api_typescript.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_api/typescript

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_api/typescript/ agdb_server/openapi/schema.json .github/workflows/agdb_api_typescript.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
if [[ "$(git diff origin/main --name-only -- ${{ env.PROJECT }}/ agdb_server/openapi/schema.json .github/workflows/agdb_api_typescript.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
agdb_api_typescript_analyse:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_api/typescript
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
Expand All @@ -36,7 +39,7 @@ jobs:
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_api/typescript
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
Expand All @@ -45,7 +48,7 @@ jobs:
if: always()
with:
name: coverage
path: agdb_api/typescript/coverage/
path: ${{ env.PROJECT }}/coverage/
retention-days: 30

agdb_api_typescript_format:
Expand All @@ -54,7 +57,7 @@ jobs:
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_api/typescript
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/agdb_benchmarks.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_benchmarks

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

agdb_benchmarks_analyse:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- run: cargo clippy --package agdb_benchmarks --all-targets --all-features -- -D warnings
- run: cargo clippy --package ${{ env.PROJECT }} --all-targets --all-features -- -D warnings

agdb_benchmarks_format:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- run: cargo fmt --package agdb_benchmarks --check
- run: cargo fmt --package ${{ env.PROJECT }} --check
11 changes: 7 additions & 4 deletions .github/workflows/agdb_server.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_server

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_server/ agdb/src/ agdb/Cargo.toml agdb_derive/src/ agdb_derive/Cargo.toml .github/workflows/agdb_server.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
if [[ "$(git diff origin/main --name-only -- ${{ env.PROJECT }}/ agdb/src/ agdb/Cargo.toml agdb_derive/src/ agdb_derive/Cargo.toml .github/workflows/${{ env.PROJECT }}.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
agdb_server_analyse:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- run: cargo clippy --package agdb_server --all-targets --all-features -- -D warnings
- run: cargo clippy --package ${{ env.PROJECT }} --all-targets --all-features -- -D warnings

agdb_server_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_server --all-features --ignore-filename-regex "agdb(.|..)src|agdb_derive|api.rs" --fail-uncovered-functions 0 --fail-uncovered-lines 0 --show-missing-lines
- run: cargo llvm-cov --package ${{ env.PROJECT }} --all-features --ignore-filename-regex "agdb(.|..)src|agdb_derive|api.rs" --fail-uncovered-functions 0 --fail-uncovered-lines 0 --show-missing-lines

agdb_server_format:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- run: cargo fmt --package agdb_server --check
- run: cargo fmt --package ${{ env.PROJECT }} --check
17 changes: 10 additions & 7 deletions .github/workflows/agdb_studio.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_studio

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_studio/ agdb_api/typescript/src/ agdb_api/typescript/package.json agdb_server/openapi/schema.json .github/workflows/agdb_studio.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
if [[ "$(git diff origin/main --name-only -- ${{ env.PROJECT }}/ agdb_api/typescript/src/ agdb_api/typescript/package.json agdb_server/openapi/schema.json .github/workflows/${{ env.PROJECT }}.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
agdb_studio_analyse:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_studio
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
Expand All @@ -36,7 +39,7 @@ jobs:
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_studio
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
Expand All @@ -45,7 +48,7 @@ jobs:
if: always()
with:
name: coverage
path: agdb_studio/coverage/
path: ${{ env.PROJECT }}/coverage/
retention-days: 30

agdb_studio_e2e:
Expand All @@ -54,7 +57,7 @@ jobs:
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_studio
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
Expand All @@ -65,7 +68,7 @@ jobs:
if: always()
with:
name: e2e
path: agdb_studio/playwright-report/
path: ${{ env.PROJECT }}/playwright-report/
retention-days: 30

agdb_studio_format:
Expand All @@ -74,7 +77,7 @@ jobs:
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_studio
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/agdb_web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: agdb_web

on:
pull_request:
branches: ["main"]

env:
PROJECT: agdb_web

jobs:
diff:
runs-on: ubuntu-latest
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: diff
shell: bash
run: |
if [[ "$(git diff origin/main --name-only -- agdb_web/ .github/workflows/${{ env.PROJECT }}.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
agdb_web_analyse:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run lint

agdb_web_coverage:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run test:unit
- uses: actions/upload-artifact@v3
if: always()
with:
name: coverage
path: ${{ env.PROJECT }}/coverage/
retention-days: 30

agdb_web_e2e:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build
- run: npm run test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: e2e
path: ${{ env.PROJECT }}/playwright-report/
retention-days: 30

agdb_web_format:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run format:check

0 comments on commit f935143

Please sign in to comment.