client fixes #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI pipeline | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{github.repository}} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- directory: ./PostManagement | |
- directory: ./JourneyService | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Run jacocoTestReport | |
working-directory: ${{matrix.directory}} | |
run: ./gradlew jacocoTestReport | |
- name: Run tests for service | |
working-directory: ${{matrix.directory}} | |
run: ./gradlew test --fail-fast | |
- name: Add test report to Codacy | |
uses: codacy/[email protected] | |
with: | |
api-token: ${{ secrets.CODACY_TOKEN }} | |
coverage-reports: ${{matrix.directory}}/build/reports/jacoco/test/jacocoTestReport.xml | |
language: java | |
build: | |
runs-on: ubuntu-latest | |
needs: test | |
strategy: | |
matrix: | |
include: | |
- dockerfile: ./JourneyService/Dockerfile | |
image: ghcr.io/AleksandraKrasteva/journey-service | |
working-directory: ./JourneyService | |
- dockerfile: ./PostManagement/Dockerfile | |
image: ghcr.io/AleksandraKrasteva/post-service | |
working-directory: ./PostManagement | |
- dockerfile: ./RabbitMQ/Dockerfile | |
image: ghcr.io/AleksandraKrasteva/rabbitmq | |
working-directory: ./RabbitMQ | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Package Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{matrix.image}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push images from matrix | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{matrix.working-directory}} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |