fix(workflow): fix package release jobs #176
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow requires Variables to be defined as follows: | |
# secrets.PUSH_TOKEN -> Password with rights to push to repository | |
name: "Tests" | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
lint-commits: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Lint Commits | |
uses: wagoid/commitlint-github-action@v6 | |
with: | |
failOnWarnings: true | |
failOnErrors: true | |
prettier: | |
runs-on: ubuntu-latest | |
needs: | |
- lint-commits | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.PUSH_TOKEN }} | |
- name: Setup NPM | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- name: Install NodeJS Dependencies | |
run: npm clean-install | |
- name: Run Prettier | |
run: npx prettier --write "**/*.{md,yaml,js,html,java,properties}" | |
- name: Commit Changes | |
id: auto-commit | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "style(all): apply prettier to '${{ github.head_ref }}'" | |
commit_user_name: github-actions | |
commit_user_email: [email protected] | |
commit_author: github-actions <[email protected]> | |
- name: Check For Updated Files | |
id: check-further-execution | |
if: steps.auto-commit.outputs.changes_detected =='true' | |
run: | | |
echo "Updates detected. Abort Workflow execution!" | | |
exit 1 | |
unit-tests: | |
runs-on: ubuntu-latest | |
needs: | |
- prettier | |
steps: | |
- name: Output Commit Ref | |
run: | | |
echo "Checking out: ${{ needs.prettier.outputs.new_sha }}" | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup Java environment | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 22 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Clean Build Artifacts | |
run: ./gradlew clean | |
- name: Run All Integration Tests | |
run: ./gradlew test | |
integration-tests: | |
runs-on: ubuntu-latest | |
needs: | |
- unit-tests | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup Java Environment | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 22 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Clean Build Artifacts | |
run: ./gradlew clean | |
- name: Run Integration Tests | |
run: ./gradlew integrationTest |