test: add e2e test scenarios #28
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: aam-backend-service-analyse | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/aam-backend-service-analyse.yml' | |
- 'application/aam-backend-service/**' | |
pull_request: | |
types: [ opened, synchronize, reopened, ready_for_review ] | |
jobs: | |
test_coverage: | |
name: Run tests and coverage calculation | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: application/aam-backend-service | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: 17 | |
cache: 'gradle' | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate Jacoco Test Report | |
run: ./gradlew jacocoTestReport --no-daemon | |
- name: Add code coverage to PR | |
uses: madrapps/[email protected] | |
with: | |
paths: application/aam-backend-service/build/reports/jacoco/test/jacocoTestReport.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
min-coverage-overall: 80 | |
min-coverage-changed-files: 80 | |
title: Code Coverage Analyse | |
update-comment: true | |
- name: Publish code coverage to code climate | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageLocations: ${{github.workspace}}/application/aam-backend-service/build/reports/jacoco/test/jacocoTestReport.xml:jacoco | |
prefix: ${{github.workspace}}/application/aam-backend-service | |
debug: true |