-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (49 loc) · 1.5 KB
/
backend-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: TWTW Backend CI
on:
push:
branches:
- 'master'
paths:
- '**.java'
pull_request:
paths:
- '**.java'
defaults:
run:
shell: bash
working-directory: ./backend
jobs:
backend-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
architecture: x64
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Apply Environment Variables
run: |
mkdir -p src/test/resources
mkdir -p src/main/resources
echo "${{ secrets.ENVIRONMENT_YML }}" > src/test/resources/application-env.yml
echo "${{ secrets.ENVIRONMENT_YML }}" > src/main/resources/application-env.yml
echo "${{ secrets.STORAGE_JSON }}" > src/test/resources/engaged-shade-405207-b8ba9bb8a30f.json
echo "${{ secrets.STORAGE_JSON }}" > src/main/resources/engaged-shade-405207-b8ba9bb8a30f.json
- run: chmod +x gradlew
- run: ./gradlew build
- run: ./gradlew jib
- name: Check test coverage
id: jacoco
uses: madrapps/[email protected]
with:
paths: ${{ github.workspace }}/backend/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.FLOWS_PAT }}
title: "Test Coverage"
min-coverage-overall: 50
min-coverage-changed-files: 50