Skip to content

surefire + moved flyway download #121

surefire + moved flyway download

surefire + moved flyway download #121

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: HolaCMS31
env:
# The hostname used to communicate with the PostgreSQL service container
DB_HOST: localhost
DB_NAME: holarse
DB_USER: holarse
DB_PASS: geheim
DB_PORT: 5432
FLYWAY_VERSION: 12.0.3
on:
push:
branches: [ "holacms31" ]
workflow_dispatch:
jobs:
holacms:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: '25'
cache: maven
distribution: 'temurin'
- name: Build
run: cd app && mvn package
- name: Upload Surefire Reports
uses: actions/upload-artifact@v4
if: always()
with:
name: surefire-test-reports
path: '**/target/surefire-reports/' # Finds reports in all modules
retention-days: 5 # Saves space by deleting old reports after 5 days
database:
runs-on: ubuntu-latest
services:
# Label used to access the service container
# https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
# https://hub.docker.com/_/postgres
postgres:
# Docker Hub image
image: postgres:16
# Provide the password for postgres
env:
POSTGRES_DB: holarse
POSTGRES_USER: holarse
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Setup Flyway
run: |
wget -qO- https://github.com/flyway/flyway/releases/download/flyway-${{ env.FLYWAY_VERSION }}/flyway-commandline-${{ env.FLYWAY_VERSION }}-linux-x64.tar.gz | tar -xvz && sudo ln -s `pwd`/flyway-${{ env.FLYWAY_VERSION }}/flyway /usr/local/bin
- name: Run Flyway Migrations
env:
FLYWAY_URL: jdbc:pgsql://${{env.DB_HOST}}:${{env.DB_PORT}}/${{env.DB_NAME}}
FLYWAY_USER: ${{env.DB_USER}}
FLYWAY_PASSWORD: ${{env.DB_PASS}}
FLYWAY_SCHEMAS: public
run: |
flyway migrate -locations="filesystem:${{ github.workspace }}/app/src/main/resources/db/migration"