-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.77 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
name: Java CI with Gradle
on:
pull_request_target:
types: [opened, reopened, synchronize, labeled]
permissions:
contents: read
jobs:
build:
if: |
(github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize') &&
contains(github.event.pull_request.labels.*.name, 'CI') &&
github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
services:
redis:
image: redis:latest
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Set test yml
uses: microsoft/variable-substitution@v1
with:
files: ./src/test/resources/application.yml
env:
spring.security.jwt.secret: ${{ secrets.JWT_SECRET_KEY }}
spring.data.mongodb.uri: ${{ secrets.MONGO_TEST_URI }}
custom.domain.image.baseUrl: ${{ secrets.BASE_URL }}
cloud.aws.s3.bucket: ${{ secrets.S3_BUCKET_NAME }}
cloud.aws.region.static: ${{ secrets.S3_REGION }}
cloud.aws.credentials.accessKey: ${{ secrets.AWS_ACCESS_KEY }}
cloud.aws.credentials.secretKey: ${{ secrets.AWS_ACCESS_SECRET }}
- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew
- name: Docker Compose For Test
run: |
touch docker-compose.yml
echo "${{ secrets.CI_DOCKER_COMPOSE }}" > docker-compose.yml
echo docker-compose.yml
docker-compose up -d
docker ps
- name: Test with Gradle
run: ./gradlew test