Skip to content

CI Build

CI Build #69

Workflow file for this run

name: CI Build
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- quarkus_auth_db
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '22'
- name: Set up Docker Compose
run: docker compose up -d
- name: Wait for user1 in PASSWORD table
run: |
echo "Waiting for MariaDB to be ready and for user1 in the PASSWORD table..."
until docker-compose exec icat_mariadb mysql -u root -ppw -D authn_db -e "SELECT 1 FROM PASSWD WHERE username='user1'" >/dev/null 2>&1; do
echo "Waiting for MariaDB and user1..."
sleep 5
done
shell: bash
- name: Build project and run unit tests
run: ./mvnw clean package -DskipTests
- name: Run integration tests
run: ./mvnw failsafe:integration-test
- name: Build native executable and run tests
run: ./mvnw package -DskipTests -Dnative -Dquarkus.native.container-build=true
- name: Login to Harbor
uses: docker/login-action@v3
with:
registry: ${{ secrets.HARBOR_URL }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
context: .
file: src/main/docker/Dockerfile.native
tags: ${{ secrets.HARBOR_URL }}/authn_simple:${{ github.ref_name }}