Skip to content

Initialization

Initialization #2

Workflow file for this run

name: Main CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Docker Compose
run: docker compose version
- name: Start services with Docker Compose
run: docker compose up -d
- name: Wait for PostgreSQL
run: |
until docker exec $(docker ps -qf "name=db") pg_isready -U postgres; do
echo "Waiting for PostgreSQL..."
sleep 2
done
- name: Set up OpenJDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Build and run tests
run: mvn verify
- name: Upload JaCoCo report
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: target/site/jacoco
- name: Upload JaCoCo coverage to Qlty Cloud
uses: qltysh/qlty-action/coverage@v1
with:
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
files: target/site/jacoco/jacoco.xml
- name: Run Checkstyle
run: mvn checkstyle:check
- name: Tear down Docker Compose
if: always()
run: docker compose down