2.2.10 #824
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: Build and deploy project | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
tags: | |
pull_request: | |
branches: | |
- main | |
- develop | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build project | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ vars.JAVA_VERSION }} | |
- name: Build project | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: | | |
assemble | |
--scan | |
- name: Upload miner jar file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: miner-jar | |
path: | | |
miner/build/libs/miner-shaded.jar | |
if-no-files-found: error | |
retention-days: 14 | |
- name: Upload viewer jar file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: viewer-jar | |
path: | | |
viewer/build/libs/viewer-*.jar | |
if-no-files-found: error | |
retention-days: 14 | |
test-miner: | |
name: Run miner tests | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
checks: write | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ vars.JAVA_VERSION }} | |
- name: Run tests | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: | | |
:miner:test | |
--scan | |
- name: Generate JaCoCo report | |
uses: gradle/gradle-build-action@v2 | |
if: always() | |
with: | |
arguments: :miner:jacocoTestReport | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: always() | |
with: | |
report_paths: 'miner/build/test-results/test/*.xml' | |
- name: Publish coverage on CodeCov | |
uses: codecov/codecov-action@v3 | |
if: always() | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: miner/build/reports/jacoco/test/jacocoTestReport.xml | |
flags: unittests-miner | |
name: codecov-github-actions | |
- name: Upload JUnit reports | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: junit-test-results-miner | |
path: | | |
miner/build/test-results/test/*.xml | |
miner/build/reports/tests/tests | |
if-no-files-found: error | |
retention-days: 14 | |
- name: Upload JaCoCo reports | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: jacoco-test-results-miner | |
path: | | |
miner/build/reports/jacoco/test/*.xml | |
miner/build/reports/jacoco | |
if-no-files-found: error | |
retention-days: 14 | |
test-viewer: | |
name: Run viewer tests | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
checks: write | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ vars.JAVA_VERSION }} | |
- name: Run tests | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: | | |
:viewer:test | |
--scan | |
- name: Generate JaCoCo report | |
uses: gradle/gradle-build-action@v2 | |
if: always() | |
with: | |
arguments: :viewer:jacocoTestReport | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: always() | |
with: | |
report_paths: 'viewer/build/test-results/test/*.xml' | |
- name: Publish coverage on CodeCov | |
uses: codecov/codecov-action@v3 | |
if: always() | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: viewer/build/reports/jacoco/test/jacocoTestReport.xml | |
flags: unittests-viewer | |
name: codecov-github-actions | |
- name: Upload JUnit reports | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: junit-test-results-viewer | |
path: | | |
viewer/build/test-results/test/*.xml | |
viewer/build/reports/tests/tests | |
if-no-files-found: error | |
retention-days: 14 | |
- name: Upload JaCoCo reports | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: jacoco-test-results-viewer | |
path: | | |
viewer/build/reports/jacoco/test/*.xml | |
viewer/build/reports/jacoco | |
if-no-files-found: error | |
retention-days: 14 | |
publish-miner: | |
name: Publish Miner on DockerHub | |
runs-on: ubuntu-latest | |
needs: | |
- test-miner | |
- test-viewer | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | |
concurrency: miner_docker | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ vars.JAVA_VERSION }} | |
- name: Calculate miner image name | |
id: miner-image-name | |
run: echo "IMAGE_NAME=${{ vars.DOCKER_IMAGE_MINER }}:${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT" | |
- name: Push branch/tag on Docker Hub | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: | | |
:miner:jib | |
-Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} | |
-Djib.to.auth.password=${{ secrets.DOCKER_TOKEN }} | |
-Djib.to.image=${{ steps.miner-image-name.outputs.IMAGE_NAME }} | |
publish-viewer: | |
name: Publish Viewer on DockerHub | |
runs-on: ubuntu-latest | |
needs: | |
- test-miner | |
- test-viewer | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | |
concurrency: viewer_docker | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ vars.JAVA_VERSION }} | |
- name: Calculate viewer image name | |
id: viewer-image-name | |
run: echo "IMAGE_NAME=${{ vars.DOCKER_IMAGE_VIEWER }}:${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT" | |
- name: Push branch/tag on Docker Hub | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: | | |
:viewer:jib | |
-Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} | |
-Djib.to.auth.password=${{ secrets.DOCKER_TOKEN }} | |
-Djib.to.image=${{ steps.viewer-image-name.outputs.IMAGE_NAME }} |