-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (40 loc) · 1.45 KB
/
UnitTest.yml
File metadata and controls
47 lines (40 loc) · 1.45 KB
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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: UnitTest
on:
pull_request:
branches:
- main
jobs:
unit-test:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# 1. Build Gradle & Test
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} # main, develop 브랜치가 아닐때만 true
# 2. Upload Jacoco Report
- name: Upload a Build Artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v3.1.3
with:
name: jacoco-report
path: build/reports/jacoco/test/html
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}