Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvlach committed Jan 7, 2024
1 parent f230fbc commit 37d4562
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 53 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/agdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: diff
Expand All @@ -22,27 +22,30 @@ jobs:
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: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo clippy --package ${{ env.PROJECT }} --package agdb_derive --all-targets --all-features -- -D warnings

agdb_coverage:
runs-on: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@cargo-llvm-cov
- run: rustup component add llvm-tools-preview
- 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: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo fmt --package ${{ env.PROJECT }} --package agdb_derive --check
17 changes: 10 additions & 7 deletions .github/workflows/agdb_api_rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: diff
Expand All @@ -22,27 +22,30 @@ jobs:
if [[ "$(git diff origin/main --name-only -- agdb_api/rust agdb/ agdb_derive/ .github/workflows/${{ env.PROJECT }}_rust.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT) fi
agdb_api_rust_analyse:
runs-on: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo clippy --package ${{ env.PROJECT }} --all-targets --all-features -- -D warnings

agdb_api_rust_coverage:
runs-on: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@cargo-llvm-cov
- run: rustup component add llvm-tools-preview
- run: cargo llvm-cov --package ${{ env.PROJECT }} --package agdb_server --all-features --ignore-filename-regex "agdb(.|..)src|agdb_server|agdb_derive" --fail-uncovered-functions 0 --fail-uncovered-lines 0 --show-missing-lines

agdb_api_rust_format:
runs-on: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo fmt --package ${{ env.PROJECT }} --check
9 changes: 5 additions & 4 deletions .github/workflows/agdb_api_typescript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: diff
Expand All @@ -29,7 +29,7 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint

Expand All @@ -41,7 +41,8 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm ci
- run: npm run test
- uses: actions/upload-artifact@v3
Expand All @@ -59,6 +60,6 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npm run format:check
19 changes: 11 additions & 8 deletions .github/workflows/agdb_benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ env:

jobs:
diff:
runs-on: rust
runs-on: ubuntu-latest
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: diff
Expand All @@ -22,25 +22,28 @@ jobs:
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: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo run --release --package ${{ env.PROJECT }}

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

agdb_benchmarks_format:
runs-on: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo fmt --package ${{ env.PROJECT }} --check
17 changes: 10 additions & 7 deletions .github/workflows/agdb_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: diff
Expand All @@ -22,27 +22,30 @@ jobs:
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: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo clippy --package ${{ env.PROJECT }} --all-targets --all-features -- -D warnings

agdb_server_coverage:
runs-on: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@cargo-llvm-cov
- run: rustup component add llvm-tools-preview
- run: cargo llvm-cov --package ${{ env.PROJECT }} --all-features --ignore-filename-regex "agdb(.|..)src|agdb_derive|agdb_api|api.rs" --fail-uncovered-functions 0 --fail-uncovered-lines 0 --show-missing-lines

agdb_server_format:
runs-on: rust
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.diff == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo fmt --package ${{ env.PROJECT }} --check
10 changes: 5 additions & 5 deletions .github/workflows/agdb_studio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: diff
Expand All @@ -29,7 +29,7 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint

Expand All @@ -41,7 +41,7 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npm run test:unit
- uses: actions/upload-artifact@v3
Expand All @@ -59,7 +59,7 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build
Expand All @@ -79,6 +79,6 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npm run format:check
10 changes: 5 additions & 5 deletions .github/workflows/agdb_web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
outputs:
diff: ${{ steps.diff.outputs.diff }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: diff
Expand All @@ -29,7 +29,7 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npx nuxt prepare
- run: npm run lint
Expand All @@ -42,7 +42,7 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npx nuxt prepare
- run: npm run test:unit
Expand All @@ -61,7 +61,7 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build
Expand All @@ -81,6 +81,6 @@ jobs:
run:
working-directory: ${{ env.PROJECT }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
- run: npm run format:check
5 changes: 3 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ env:

jobs:
codecov:
runs-on: rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@cargo-llvm-cov
- run: rustup component add llvm-tools-preview
- run: cargo llvm-cov --package agdb --package agdb_server --all-features --ignore-filename-regex "agdb(_derive|_benchmarks)|api.rs" --lcov --output-path lcov.info
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ env:

jobs:
build:
runs-on: rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo build --package agdb_derive --package agdb --all-features --release

new_version:
runs-on: rust
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.new_version.outputs.new_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- id: new_version
run: |
PUBLISHED_VERSION=$(cargo search ^agdb$ --limit 1 -q | head -n 1 | cut -d '"' -f 2)
Expand All @@ -32,11 +34,12 @@ jobs:
echo "Current version: ${CURRENT_VERSION}"
release:
runs-on: rust
runs-on: ubuntu-latest
needs: [build, new_version]
if: needs.new_version.outputs.new_version != ''
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
Expand All @@ -48,11 +51,12 @@ jobs:
generate_release_notes: true

publish:
runs-on: rust
runs-on: ubuntu-latest
needs: [release, new_version]
if: needs.new_version.outputs.new_version != ''
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: |
cargo publish --package agdb_derive --token ${CRATES_IO_TOKEN}
cargo publish --package agdb --token ${CRATES_IO_TOKEN}
Expand Down

0 comments on commit 37d4562

Please sign in to comment.