Skip to content

Add codecov to pipeline #7

Add codecov to pipeline

Add codecov to pipeline #7

Workflow file for this run

name: Build and Test Gradle project
on:
push:
pull_request:
jobs:
build-and-test:
uses: ASE-WS23-GruppeA/workout-tracker/.github/workflows/gradle-build-and-test.yml@main
test-and-upload-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 21
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: '8.5'
- name: Execute Gradle build
run: ./gradlew clean jacocoTestReport
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_report
path: build/reports/jacoco/test/html
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build-and-push-docker:
needs: build-and-test
uses: ASE-WS23-GruppeA/workout-tracker/.github/workflows/docker-build-and-push.yml@main
with:
docker_image_tag: 'registry.digitalocean.com/do-ase-registry/user-service'
secrets:
DIGITALOCEAN_ACCESS_TOKEN: "${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}"
restart-application:
needs: build-and-push-docker
uses: ASE-WS23-GruppeA/workout-tracker/.github/workflows/docker-compose-restart.yml@main
secrets:
DROPLET_IP_ADDRESS: "${{ secrets.DROPLET_IP_ADDRESS }}"
DROPLET_SSH_KEY: "${{ secrets.DROPLET_SSH_KEY }}"