Skip to content

build(deps): bump au.com.dius.pact.consumer:junit5 from 4.6.7 to 4.6.9 #386

build(deps): bump au.com.dius.pact.consumer:junit5 from 4.6.7 to 4.6.9

build(deps): bump au.com.dius.pact.consumer:junit5 from 4.6.7 to 4.6.9 #386

Workflow file for this run

# Build Java JAR and publish as Docker image to Docker Hub.
#
# Adopted from
#
# - https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build and Publish
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build and Test with Gradle
run: ./gradlew clean build test cucumber jacocoTestReport
- name: Attach JAR as Build Artifact
uses: actions/upload-artifact@v4
with:
name: train-delays-0.0.1-SNAPSHOT.jar
path: build/libs/train-delays-0.0.1-SNAPSHOT.jar
- name: Attach Test Results as Build Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
build/reports/jacoco/test
build/reports/tests
publish-reports:
name: Publish Test Reports
runs-on: ubuntu-latest
# Repository secrets may only be used when running on the controlled main branch
# otherwise we run the risk of exposing secrets to a malicious attacker
# AND
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace'
if: github.ref == 'refs/heads/main' && github.repository == 'wonderbird/train-delays'
needs: build-and-test
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Download Test Results
uses: actions/download-artifact@v4
with:
name: test-results
path: build/reports
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Report Coverage to Coveralls
run: ./gradlew coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Report Coverage to CodeClimate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
JACOCO_SOURCE_PATH: "src/main/java"
with:
coverageLocations: build/reports/jacoco/test/jacocoTestReport.xml:jacoco
publish-docker-image:
# Documentation: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
name: Publish Docker Image
runs-on: ubuntu-latest
# Repository secrets may only be used when running on the controlled main branch
# otherwise we run the risk of exposing secrets to a malicious attacker
# AND
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace'
if: github.ref == 'refs/heads/main' && github.repository == 'wonderbird/train-delays'
needs: build-and-test
steps:
- uses: actions/checkout@v4
- name: Download JAR
uses: actions/download-artifact@v4
with:
name: train-delays-0.0.1-SNAPSHOT.jar
path: build/libs
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: boos/train-delays
tags: type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}