build: Revised github actions workflows #52
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
name: Gradle Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Grant permissions | |
run: chmod +x gradlew | |
- name: Build | |
run: ./gradlew assemble -x test | |
unit-tests: | |
name: Unit Tests | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Run Unit Tests | |
run: ./gradlew test | |
- name: Upload Unit Test Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unit_test_results | |
path: | | |
build/test-results/test/*.xml | |
integration-tests: | |
name: Integration Tests | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Run Integration Tests | |
run: ./gradlew -x test quarkusIntTest | |
- name: Upload Integration Test Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: integration_test_results | |
path: | | |
build/test-results/quarkusIntTest/*.xml | |
code-analysis: | |
name: CodeQL Analysis | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: java | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
event_file: | |
name: "Event File" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: event_file | |
path: ${{ github.event_path }} |