-
Notifications
You must be signed in to change notification settings - Fork 8
75 lines (65 loc) · 1.88 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Backend CI
on:
workflow_dispatch:
pull_request:
branches: ['develop']
permissions:
checks: write
pull-requests: write
jobs:
detect-changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
manual: ${{ steps.manualcheck.outputs.manual }}
steps:
- id: manualcheck
if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo "manual=true" >> "$GITHUB_OUTPUT"
- uses: dorny/paths-filter@v3
if: ${{ github.event_name != 'workflow_dispatch' }}
id: filter
with:
filters: |
backend:
- 'backend/**'
frontend:
- 'frontend/**'
list-files: 'csv'
be-test:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.backend == 'true' || needs.detect-changes.outputs.manual == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Grant gradlew execute permission
run: chmod +x ./gradlew
- name: Test with Gradle
run: ./gradlew clean test
- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
backend/build/test-results/test/TEST-*.xml
- name: Add comments to PR
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: |
backend/build/test-results/test/TEST-*.xml