-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (79 loc) · 2.6 KB
/
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: CI
on:
push:
branches: ["feature", "FE/#207"]
pull_request:
branches: ["feature", "FE/#207"]
jobs:
backend-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: backend/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('backend/**/*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Grant Execute Permission For Gradlew
run: chmod +x backend/gradlew
- name: Make properties
run: |
cd backend/src/main/resources
touch ./application-local.yml
touch ./application-docker.yml
echo "${{ secrets.TEST_PROPERTIES }}" > ./application-local.yml
echo "${{ secrets.DOCKER_TEST_PROPERTIES }}" > ./application-docker.yml
cd ../../test/resources
touch ./application-test.yml
echo "${{ secrets.INTEGRATION_TEST_PROPERTIES }}" > ./application-test.yml
shell: bash
- name: Test with Gradle
run: |
cd backend
./gradlew build --info
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
GPT_TOKEN: ${{ secrets.GPT_TOKEN }}
JOB_KEY: ${{ secrets.JOB_KEY }}
- name: Backend Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: ${{ always() }}
with:
files: backend/build/test-results/**/*.xml
frontend-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache frontend packages
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-frontend-
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install packages
working-directory: frontend
run: yarn install --immutable --immutable-cache --check-cache
- name: Prettier
working-directory: frontend
run: yarn format
- name: ESLint
working-directory: frontend
run: yarn lint
# - name: Frontend Test
# working-directory: frontend
# run: npm test
# - name: Frontend Test Results
# uses: EnricoMi/publish-unit-test-result-action@v1
# if: ${{ always() }}
# with:
# files: frontend/test-results.xml