Skip to content

🌎 Deploy: add PR test & yml configuration at ci pipeline #13

🌎 Deploy: add PR test & yml configuration at ci pipeline

🌎 Deploy: add PR test & yml configuration at ci pipeline #13

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: ['**']
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Create application.yml
run: |
mkdir -p src/main/resources
echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml
echo "${{ secrets.APPLICATION_YML_DEV }}" > ./src/main/resources/application-dev.yml
echo "${{ secrets.APPLICATION_YML_PROD }}" > ./src/main/resources/application-prod.yml
echo "${{ secrets.APPLICATION_YML_SECRET }}" > ./src/main/resources/application-secret.yml
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Run Tests with Coverage
run: ./gradlew jacocoTestReport
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ always() }}
with:
files: build/test-results/**/*.xml
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: jacoco-html-report
path: build/reports/jacoco/test/html
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}