Skip to content

Bump actions/setup-node from 3 to 4 #448

Bump actions/setup-node from 3 to 4

Bump actions/setup-node from 3 to 4 #448

Workflow file for this run

name: jooqx
on:
create:
branches: [ 'release/**' ]
push:
branches: [ main ]
tags: [ 'v*' ]
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '.github/*.yml'
- '*.md'
- 'LICENSE'
- 'webdocs/**'
pull_request:
types: [ opened, synchronize, reopened, closed ]
branches: [ main ]
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '.github/*.yml'
- '*.md'
- 'LICENSE'
- 'webdocs/**'
env:
PROFILE: 'jooqx'
JAVA_DIST: 'temurin'
jobs:
context:
uses: ./.github/workflows/subwf-context.yml
with:
profile: 'jooqx'
skipBranchPattern: '^(jpa|rsql)/.*'
secrets:
githubToken: ${{ secrets.OSS_GITHUB_TOKEN }}
gpgKey: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }}
build:
needs: context
if: needs.context.outputs.shouldBuild == 'true'
strategy:
matrix:
java: [ '8', '11', '17' ]
os: [ 'ubuntu-latest', 'windows-latest' ]
name: Build Java ${{ matrix.java }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
PROFILE: 'ciBuild'
steps:
- uses: actions/[email protected]
- name: Build
uses: ./.github/actions/gha-build
with:
profile: ${{ env.PROFILE }}
version: ${{ needs.context.outputs.version }}
semanticVersion: ${{ needs.context.outputs.semanticVersion }}
hashVersion: ${{ needs.context.outputs.commitId }}
javaDist: ${{ env.JAVA_DIST }}
javaVersion: ${{ matrix.java }}
analysis:
needs: context
if: needs.context.outputs.shouldBuild == 'true'
strategy:
matrix:
java: [ '11' ]
os: [ 'ubuntu-latest' ]
db: [ 'pg:10-alpine', 'pg:12-alpine', 'pg:14-alpine', 'h2', 'mysql:5.7-debian', 'mysql:8.0-debian' ]
fail-fast: false
name: Test ${{ matrix.db }} | Java ${{ matrix.java }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
PROFILE: 'ciSonar'
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
submodules: 'true'
- uses: actions/[email protected]
with:
distribution: ${{ env.JAVA_DIST }}
java-version: ${{ matrix.java }}
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ matrix.db }}-${{ runner.os }}-${{ matrix.java }}-${{ env.JAVA_DIST }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ matrix.db }}-${{ runner.os }}-${{ matrix.java }}-${{ env.JAVA_DIST }}-gradle-
- name: Get context
id: db_profile
shell: bash
run: |
echo project=$(echo ${{ matrix.db }} | cut -d':' -f1) >> $GITHUB_OUTPUT
echo dbVersion=$(echo ${{ matrix.db }} | cut -d':' -f2) >> $GITHUB_OUTPUT
# - name: Cache SonarCloud packages
# uses: actions/[email protected]
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
- name: Generate jOOQ test schema
shell: bash
run: |
./gradlew --stacktrace \
:integtest:${{ steps.db_profile.outputs.project }}:generateJooq \
-Pprofile=${{ env.PROFILE }} \
-PdbVersion=${{ steps.db_profile.outputs.dbVersion }} \
-PsemanticVersion=${{ needs.context.outputs.semanticVersion }}
- name: Run test
shell: bash
run: |
count=$(./gradlew --stacktrace \
:integtest:${{ steps.db_profile.outputs.project }}:test \
:integtest:${{ steps.db_profile.outputs.project }}:jacocoTestReport \
-Pprofile=${{ env.PROFILE }} \
-PdbVersion=${{ steps.db_profile.outputs.dbVersion }} \
-PsemanticVersion=${{ needs.context.outputs.semanticVersion }} \
| tee 1>&2 | grep -c 'There were failing tests' ||:)
(( $count > 0 )) && exit 1 || echo
# - name: SonarQube
# shell: bash
# run: |
# ./gradlew sonarqube -x test --stacktrace \
# -Pprofile=${{ env.PROFILE }} \
# -PsemanticVersion=${{ needs.context.outputs.semanticVersion }} \
# -Dsonar.branch.name=${{ needs.context.outputs.branch }} \
# -Dsonar.login=${{ secrets.OSS_SONARQUBE_TOKEN }} \
# -Dorg.gradle.jvmargs="-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs: [ context, build, analysis ]
if: needs.context.outputs.shouldPublish == 'true' || needs.context.outputs.isRelease == 'true'
uses: ./.github/workflows/subwf-publish.yml
with:
profile: 'jooqx'
version: ${{ needs.context.outputs.version }}
semanticVersion: ${{ needs.context.outputs.semanticVersion }}
hashVersion: ${{ needs.context.outputs.commitId }}
isRelease: ${{ needs.context.outputs.isRelease }}
secrets:
ossrhUser: ${{ secrets.OSS_SONATYPE_USER }}
ossrhToken: ${{ secrets.OSS_SONATYPE_PASSWORD }}
gpgKey: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }}
docs:
runs-on: ubuntu-latest
needs: [ context, build ]
if: needs.context.outputs.shouldPublish == 'true' || needs.context.outputs.isRelease == 'true'
env:
REPO: zero88/jooqx
REF: main
WORKFLOW: wfd-docs.yml
GITHUB_TOKEN: ${{ secrets.OSS_GITHUB_TOKEN }}
steps:
- name: Trigger build ${{ env.PROFILE }} documentation
shell: bash
run: |
gh workflow run ${{ env.WORKFLOW }} --repo ${{ env.REPO }} --ref ${{ env.REF }} \
-f profile=${{ env.PROFILE }} \
-f version=${{ needs.context.outputs.version }} \
-f semanticVersion=${{ needs.context.outputs.semanticVersion }} \
-f hashVersion=${{ needs.context.outputs.commitId }} \
-f sha=${{ needs.context.outputs.sha }} \
-f isRelease=${{ needs.context.outputs.isRelease }} \
-f antoraBuildDir=docs/build/docs/antora
- name: Verify GitHub workflow run
shell: bash
run: |
sleep 5
fields=workflowDatabaseId,databaseId,status,event,headBranch,headSha,name,conclusion,url,createdAt,updatedAt
gh run list -R ${{ env.REPO }} -b ${{ env.REF }} -w ${{ env.WORKFLOW }} -L 1 --json $fields | jq
release:
runs-on: ubuntu-latest
needs: [ context, publish, docs ]
if: needs.context.outputs.isRelease == 'true'
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ env.PROFILE }} ${{ needs.context.outputs.version }}
tag_name: ${{ needs.context.outputs.branch }}
generate_release_notes: true