-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.09 KB
/
spring-boot-gradle-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
name: Spring Boot Gradle CI
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: '21'
distribution: 'adopt'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create application-test.yml from secret
env:
COMMON_TEST_YML: ${{ secrets.COMMON_TEST_YML }}
COMMON_TEST_DIR: /stempo-common/src/test/resources
COMMON_DIR_FILE_NAME: application-test.yml
run: |
mkdir -p $COMMON_TEST_DIR
echo $COMMON_TEST_YML | base64 --decode > $COMMON_TEST_DIR/$COMMON_DIR_FILE_NAME
- name: Build and test with Gradle
run: ./gradlew build test --args='-Dspring.profiles.active=test'
- name: Check build status
run: |
if [[ $? -ne 0 ]]; then
echo "Build failed!"
exit 1
else
echo "Build succeeded!"
fi