Skip to content

fix: interference api upload issues #7

fix: interference api upload issues

fix: interference api upload issues #7

Workflow file for this run

name: Test Build
on:
pull_request:
branches:
- main
- "release/**"
permissions:
contents: read
checks: write
pull-requests: write
packages: write
jobs:
build-and-test:
runs-on: ubuntu-latest
outputs:
pr_number: ${{ github.event.pull_request.number }}
short_sha: ${{ steps.short_sha.outputs.short_sha }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get Short SHA
id: short_sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "corretto"
cache: "maven"
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: |
~/.m2/repository
!~/.m2/repository/org/devgateway/tcdi
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and Test
run: mvn -B verify -Dcheckstyle.skip=true -Dtest='!**/DatasetClientTest' --file pom.xml
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
**/target/surefire-reports/*.xml
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
**/target/*.jar
retention-days: 7
build-and-push-docker-image:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
cache-from: type=gha, scope=data-viz-admin
cache-to: type=gha, scope=data-viz-admin
context: .
push: true
build-args: |
VERSION=pr-${{ needs.build-and-test.outputs.pr_number }}
TAG=${{ needs.build-and-test.outputs.short_sha }}
GIT_BRANCH=${{ github.head_ref }}
tags: |
${{ vars.DOCKER_REGISTRY }}/data-viz-admin:pr-${{ needs.build-and-test.outputs.pr_number }}
${{ vars.DOCKER_REGISTRY }}/data-viz-admin:pr-${{ needs.build-and-test.outputs.pr_number }}-${{ needs.build-and-test.outputs.short_sha }}