Skip to content

chore(deps): bump unirest-version from 4.0.1 to 4.0.3 #634

chore(deps): bump unirest-version from 4.0.1 to 4.0.3

chore(deps): bump unirest-version from 4.0.1 to 4.0.3 #634

name: Build and deploy project
on:
push:
branches:
- main
- develop
tags:
pull_request:
branches:
- main
- develop
workflow_dispatch:
env:
APP_JAVA_VERSION: 17
DOCKER_MINER_IMAGE_NAME: mrcraftcod/channel-points-miner
DOCKER_VIEWER_IMAGE_NAME: mrcraftcod/channel-points-miner-viewer
jobs:
build:
name: Build project
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ env.APP_JAVA_VERSION }}
- name: Set gradlew executable
run: chmod +x ./gradlew
- 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
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ env.APP_JAVA_VERSION }}
- name: Set gradlew executable
run: chmod +x ./gradlew
- 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@v3
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
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ env.APP_JAVA_VERSION }}
- name: Set gradlew executable
run: chmod +x ./gradlew
- 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@v3
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@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ env.APP_JAVA_VERSION }}
- name: Set gradle permissions
run: chmod +x gradlew
- name: Push branch/tag on Docker Hub
run: ./gradlew :miner:jib -PdockerUsername=${{ secrets.DOCKER_USERNAME }} -PdockerPassword=${{ secrets.DOCKER_TOKEN }} -Djib.to.image="${DOCKER_MINER_IMAGE_NAME}:${GITHUB_REF##*/}"
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@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ env.APP_JAVA_VERSION }}
- name: Set gradle permissions
run: chmod +x gradlew
- name: Push branch/tag on Docker Hub
run: ./gradlew :viewer:jib -PdockerUsername=${{ secrets.DOCKER_USERNAME }} -PdockerPassword=${{ secrets.DOCKER_TOKEN }} -Djib.to.image="${DOCKER_VIEWER_IMAGE_NAME}:${GITHUB_REF##*/}"