-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (57 loc) · 1.89 KB
/
ci-test.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
name: Run Tests on PR
on:
pull_request:
types: [ opened, synchronize, reopened ]
permissions:
contents: write
pull-requests: write
checks: write
jobs:
test:
env:
IMP_API_KEY: ${{ secrets.IMP_API_KEY }}
IMP_SECRET_KEY: ${{ secrets.IMP_SECRET_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'adopt'
env:
IMP_API_KEY: ${{ secrets.IMP_API_KEY }}
IMP_SECRET_KEY: ${{ secrets.IMP_SECRET_KEY }}
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
env:
IMP_API_KEY: ${{ secrets.IMP_API_KEY }}
IMP_SECRET_KEY: ${{ secrets.IMP_SECRET_KEY }}
- name: Upload test report
if: always()
uses: actions/upload-artifact@v3
with:
name: test-report
path: build/reports/tests/test
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Run tests
run: SPRING_PROFILES_ACTIVE=[test] ./gradlew test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 테스트 결과를 PR에 코멘트로 등록합니다
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: '**/build/test-results/test/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
seconds_between_github_reads: 5
seconds_between_github_writes: 5