File tree Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Original file line number Diff line number Diff line change 99 types : [opened, synchronize, reopened]
1010
1111jobs :
12- build-and-test :
12+ # --------------------------
13+ # main 브랜치용 build & test
14+ # --------------------------
15+ build-and-test-main :
16+ if : github.base_ref == 'main' # main 브랜치로 PR이 들어올 때만 실행
1317 runs-on : ubuntu-latest
1418
1519 services :
2327 ports :
2428 - 3306:3306
2529 env :
26- MYSQL_ROOT_PASSWORD : root
30+ MYSQL_ROOT_PASSWORD : root_pass
2731 MYSQL_DATABASE : testdb
32+ # MySQL 헬스체크, MySQL 실행 준비 중인 동안 스프링부트 실행을 방지
2833 options : >-
2934 --health-cmd="mysqladmin ping -h localhost -p$MYSQL_ROOT_PASSWORD"
3035 --health-interval=10s
5257 run : ./gradlew clean build -x test
5358
5459 # Test 실행
60+ - name : Run tests
61+ run : ./gradlew test
62+
63+ # --------------------------
64+ # dev 브랜치용 build & test
65+ # --------------------------
66+ build-and-test-dev :
67+ if : github.base_ref == 'dev' # dev 브랜치로 PR이 들어올 때만 실행
68+ runs-on : ubuntu-latest
69+
70+ services :
71+ redis :
72+ image : redis:7
73+ ports :
74+ - 6379:6379
75+
76+ steps :
77+ - name : Checkout repository
78+ uses : actions/checkout@v4
79+
80+ - name : Set up Java 21
81+ uses : actions/setup-java@v3
82+ with :
83+ distribution : ' temurin'
84+ java-version : ' 21'
85+
86+ - name : Create .env file
87+ run : echo "${{ secrets.DOT_ENV }}" > .env
88+
89+ - name : Build project
90+ run : ./gradlew clean build -x test
91+
5592 - name : Run tests
5693 run : ./gradlew test
You can’t perform that action at this time.
0 commit comments