forked from woowacourse-teams/2022-moamoa
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.85 KB
/
backend.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
name: backend
on:
push:
branches:
- main
paths:
- "backend/**"
pull_request:
paths:
- "backend/**"
branches:
- main
- develop
types: [opened, synchronize]
defaults:
run:
working-directory: backend
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_PROJECT_KEY: moamoa
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
client-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
jwt-secret-key: ${{ secrets.JWT_SECRET_KEY }}
jwt-expire-length: ${{ secrets.JWT_EXPIRE_LENGTH }}
SLACK_USERS : ${{secrets.SLACK_USERS}}
SLACK_SAND_MESSAGE : ${{secrets.SLACK_SAND_MESSAGE}}
SLACK_AUTHORIZATION : ${{secrets.SLACK_AUTHORIZATION}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
- name: Build
run: ./gradlew build --exclude-task test --exclude-task asciidoctor
- name: Test
run: ./gradlew test -Dmoamoa.allow-origins='*' -Doauth2.github.client-id=${{ env.client-id }} -Doauth2.github.client-secret=${{ env.client-secret }} -Dsecurity.jwt.token.secret-key=${{ env.jwt-secret-key }} -Dsecurity.jwt.token.expire-length=${{ env.jwt-expire-length }} -Dslack.authorization=${{ env.SLACK_AUTHORIZATION }} -Dslack.users=${{ env.SLACK_USERS }} -Dslack.send.message=${{ env.SLACK_SAND_MESSAGE }}
- name: SonarQube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew sonarqube --info