Skip to content
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

update workflow actions #269

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 13 additions & 26 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,56 +13,43 @@ jobs:
benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
benchmark: [codegen, dao]
steps:
- id: checkout
name: Clone Git Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: commits
name: Count Commits
run: echo "count=$(git rev-list --count HEAD --since='last week')" >> $GITHUB_OUTPUT
- id: previous
name: Get Last Release
if: steps.commits.outputs.count > 0
run: echo "version=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
- id: last_release
name: Fetch last release info
run: echo "tag=$(gh release view --json tagName --jq '.tagName')" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: java
name: Setup Java
if: steps.commits.outputs.count > 0
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
java-package: ${{ env.JAVA_PACKAGE }}
architecture: ${{ env.JAVA_ARCH }}
distribution: ${{ env.JAVA_DISTRO }}
- id: cache
name: Cache Maven Repository
if: steps.commits.outputs.count > 0
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: maven
- id: run-benchmark
name: Run Benchmark [${{ matrix.benchmark }}]
if: steps.commits.outputs.count > 0
run: mvn --batch-mode --projects yosql-benchmarks/yosql-benchmarks-${{ matrix.benchmark }} --also-make --activate-profiles benchmarks verify --define org.slf4j.simpleLogger.log.yosql=warn --define skipTests 2>&1 1> build.log
- id: copy-results
name: Copy ${{ matrix.benchmark }} Results
if: steps.commits.outputs.count > 0
run: cp --force ./yosql-benchmarks/yosql-benchmarks-${{ matrix.benchmark }}/target/benchmark/yosql-benchmarks-${{ matrix.benchmark }}.json ./yosql-website/content/benchmarks/results/yosql-benchmarks-${{ matrix.benchmark }}-${{ steps.previous.outputs.version }}.json
run: cp --force ./yosql-benchmarks/yosql-benchmarks-${{ matrix.benchmark }}/target/benchmark/yosql-benchmarks-${{ matrix.benchmark }}.json ./yosql-website/content/benchmarks/results/yosql-benchmarks-${{ matrix.benchmark }}-${{ steps.last_release.outputs.tag }}.json
- id: replace-results
name: Replace CURRENT ${{ matrix.benchmark }} Results
if: steps.commits.outputs.count > 0
run: cp --force ./yosql-benchmarks/yosql-benchmarks-${{ matrix.benchmark }}/target/benchmark/yosql-benchmarks-${{ matrix.benchmark }}.json ./yosql-website/content/benchmarks/results/yosql-benchmarks-${{ matrix.benchmark }}-CURRENT.json
- id: push
name: Push Changes
if: steps.commits.outputs.count > 0
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update benchmark data for ${{ steps.previous.outputs.version }}
commit_message: Update benchmark data for ${{ steps.last_release.outputs.tag }}
file_pattern: yosql-website/*.json
32 changes: 8 additions & 24 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,25 @@ name: CodeQL
on:
schedule:
- cron: 44 20 * * 6
env:
JAVA_VERSION: 17
JAVA_PACKAGE: jdk
JAVA_ARCH: x64
JAVA_DISTRO: temurin
GRAAL_VERSION: latest
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ java ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: ${{ env.GRAAL_VERSION }}
java-version: ${{ env.JAVA_VERSION }}
components: native-image
distribution: graalvm
java-version: 17
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: maven
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
languages: java
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
15 changes: 15 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Dependabot auto-merge
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 0 additions & 16 deletions .github/workflows/qodana.yml

This file was deleted.

22 changes: 9 additions & 13 deletions .github/workflows/release-announcement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,31 @@ jobs:
steps:
- id: checkout
name: Clone Git Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: commits
name: Count Commits
run: echo "count=$(git rev-list --count HEAD --since='last week')" >> $GITHUB_OUTPUT
- id: previous
name: Get Last Release
if: steps.commits.outputs.count > 0
run: echo "version=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
- id: last_release
name: Fetch last release info
run: echo "tag=$(gh release view --json tagName --jq '.tagName')" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: mail
name: Send Mail
if: steps.commits.outputs.count > 0
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{ secrets.MAIL_SERVER }}
server_port: ${{ secrets.MAIL_PORT }}
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: ${{ github.event.repository.name }} version ${{ steps.previous.outputs.version }} published
body: See https://github.com/metio/yosql/releases/tag/${{ steps.previous.outputs.version }} for details.
subject: ${{ github.event.repository.name }} version ${{ steps.last_release.outputs.tag }} published
body: See https://github.com/metio/yosql/releases/tag/${{ steps.last_release.outputs.tag }} for details.
to: ${{ secrets.MAIL_RECIPIENT }}
from: ${{ secrets.MAIL_SENDER }}
- id: matrix
name: Send Matrix Message
if: steps.commits.outputs.count > 0
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: ${{ github.event.repository.name }} version [${{ steps.previous.outputs.version }}](https://github.com/metio/yosql/releases/tag/${{ steps.previous.outputs.version }}) published
message: ${{ github.event.repository.name }} version [${{ steps.last_release.outputs.tag }}](https://github.com/metio/yosql/releases/tag/${{ steps.last_release.outputs.tag }}) published
server: ${{ secrets.MATRIX_SERVER }}
77 changes: 22 additions & 55 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ env:
JAVA_PACKAGE: jdk
JAVA_ARCH: x64
JAVA_DISTRO: temurin
GRAAL_VERSION: latest
jobs:
prepare:
name: Prepare Release
runs-on: ubuntu-latest
outputs:
commit_count: ${{ steps.commits.outputs.count }}
previous_version: ${{ steps.last_release.outputs.version }}
release_version: ${{ steps.release.outputs.version }}
previous_version: ${{ steps.previous.outputs.version }}
steps:
- id: checkout
name: Clone Git Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: last_release
name: Fetch last release info
run: echo "tag=$(gh release view --json tagName --jq '.tagName')" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: commits
name: Count Commits
run: echo "count=$(git rev-list --count HEAD --since='last week')" >> $GITHUB_OUTPUT
run: echo "count=$(git rev-list --count ${{ steps.last_release.outputs.tag }}..HEAD)" >> $GITHUB_OUTPUT
- id: release
name: Create Release Version
if: steps.commits.outputs.count > 0
run: echo "version=$(date +'%Y.%-m.%-d')" >> $GITHUB_OUTPUT
- id: previous
name: Get Last Release
if: steps.commits.outputs.count > 0
run: echo "version=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
- id: timestamp
name: Build Timestamp
if: steps.commits.outputs.count > 0
Expand All @@ -46,11 +46,11 @@ jobs:
- id: checkout
name: Clone Git Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/checkout@v3
uses: actions/checkout@v4
- id: java
name: Setup Java
if: needs.prepare.outputs.commit_count > 0
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
java-package: ${{ env.JAVA_PACKAGE }}
Expand All @@ -59,15 +59,7 @@ jobs:
server-id: ossrh
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- id: cache
name: Cache Maven Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: maven
- id: gpg
name: GPG Key
if: needs.prepare.outputs.commit_count > 0
Expand All @@ -94,25 +86,17 @@ jobs:
- id: checkout
name: Clone Git Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/checkout@v3
uses: actions/checkout@v4
- id: java
name: Setup Java
if: needs.prepare.outputs.commit_count > 0
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
java-package: ${{ env.JAVA_PACKAGE }}
architecture: ${{ env.JAVA_ARCH }}
distribution: ${{ env.JAVA_DISTRO }}
- id: cache
name: Cache Maven Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: maven
- name: Set release version
if: needs.prepare.outputs.commit_count > 0
run: mvn --batch-mode versions:set --define newVersion=${{ needs.prepare.outputs.release_version }} --define generateBackupPoms=false
Expand All @@ -136,25 +120,17 @@ jobs:
- id: checkout
name: Clone Git Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/checkout@v3
uses: actions/checkout@v4
- id: java
name: Setup Java
if: needs.prepare.outputs.commit_count > 0
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
java-package: ${{ env.JAVA_PACKAGE }}
architecture: ${{ env.JAVA_ARCH }}
distribution: ${{ env.JAVA_DISTRO }}
- id: cache
name: Cache Maven Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: maven
- id: gpg
name: GPG Key
if: needs.prepare.outputs.commit_count > 0
Expand Down Expand Up @@ -191,29 +167,20 @@ jobs:
- id: checkout
name: Clone Git Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/checkout@v3
uses: actions/checkout@v4
- id: graal
name: Setup GraalVM
if: needs.prepare.outputs.commit_count > 0
uses: graalvm/setup-graalvm@v1
with:
version: ${{ env.GRAAL_VERSION }}
distribution: graalvm
java-version: ${{ env.JAVA_VERSION }}
components: native-image
github-token: ${{ secrets.GITHUB_TOKEN }}
- id: cache
name: Cache Maven Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: maven
- id: gpg
name: GPG Key
if: needs.prepare.outputs.commit_count > 0
uses: timheuer/base64-to-file@v1.2
uses: timheuer/base64-to-file@v1
with:
fileName: signing.key.asc
fileDir: ${{ github.workspace}}
Expand Down Expand Up @@ -263,7 +230,7 @@ jobs:
- id: checkout
name: Clone Git Repository
if: needs.prepare.outputs.commit_count > 0
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: download
Expand Down
Loading