-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor/#209] 테스트 컨테이너 및 액션 개선 #327
Changes from all commits
5600fb2
3187a1d
95ab575
e1f2e7c
33d576b
a8abfc3
cda632b
84c2a82
d940561
5bc7062
7de0216
7481059
d061cb9
dd3dd75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ env: | |
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }} | ||
|
||
jobs: | ||
validate-test: | ||
setup-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -34,8 +34,139 @@ jobs: | |
|
||
- name: Jooq Code Generation | ||
run: | | ||
./gradlew --info jooqCodegenAll | ||
./gradlew jooqCodegenAll | ||
|
||
- name: Test with Gradle | ||
- name: Cache Api Repo Jooq | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./api-repo/src/generated | ||
./api-repo/src/main/resources/db/migration | ||
key: ${{ runner.os }}-api-repo-jooq-${{ hashFiles('./api-repo/src/generated/**', './api-repo/src/main/resources/db/migration/**') }} | ||
restore-keys: | | ||
${{ runner.os }}-api-repo-jooq- | ||
|
||
- name: Cache Batch Jooq | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./batch/src/generated | ||
./batch/src/main/resources/db/migration | ||
key: ${{ runner.os }}-batch-jooq-${{ hashFiles('./batch/src/generated/**', './batch/src/main/resources/db/migration/**') }} | ||
restore-keys: | | ||
${{ runner.os }}-batch-jooq- | ||
Comment on lines
+39
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jooq 관련 파일을 캐싱합니다. |
||
|
||
api-test: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아래 각각의 모듈 별로 필요한 캐싱된 값을 받아 테스트를 수행합니다. |
||
needs: setup-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Cache Gradle | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
|
||
- name: Cache Api Repo Jooq | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./api-repo/src/generated | ||
./api-repo/src/main/resources/db/migration | ||
key: ${{ runner.os }}-api-repo-jooq-${{ hashFiles('./api-repo/src/generated/**', './api-repo/src/main/resources/db/migration/**') }} | ||
restore-keys: | | ||
${{ runner.os }}-api-repo-jooq- | ||
|
||
- name: Cache Batch Jooq | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./batch/src/generated | ||
./batch/src/main/resources/db/migration | ||
key: ${{ runner.os }}-batch-jooq-${{ hashFiles('./batch/src/generated/**', './batch/src/main/resources/db/migration/**') }} | ||
restore-keys: | | ||
${{ runner.os }}-batch-jooq- | ||
|
||
- name: API Test with Gradle | ||
run: | | ||
./gradlew --info test | ||
./gradlew api:test | ||
|
||
api-repo-test: | ||
needs: setup-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Cache Gradle | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-jooq-${{ hashFiles('./api-repo/src/generated/**', './api-repo/src/main/resources/db/migration/**', './batch/src/generated/**', './batch/src/main/resources/db/migration/**') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
|
||
- name: Cache Api Repo Jooq | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./api-repo/src/generated | ||
./api-repo/src/main/resources/db/migration | ||
key: ${{ runner.os }}-api-repo-jooq-${{ hashFiles('./api-repo/src/generated/**', './api-repo/src/main/resources/db/migration/**') }} | ||
restore-keys: | | ||
${{ runner.os }}-api-repo-jooq- | ||
|
||
- name: API Repo Test with Gradle | ||
run: | | ||
./gradlew api-repo:test | ||
|
||
batch-test: | ||
needs: setup-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Cache Gradle | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
|
||
- name: Cache Batch Jooq | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./batch/src/generated | ||
./batch/src/main/resources/db/migration | ||
key: ${{ runner.os }}-batch-jooq-${{ hashFiles('./batch/src/generated/**', './batch/src/main/resources/db/migration/**') }} | ||
restore-keys: | | ||
${{ runner.os }}-batch-jooq- | ||
|
||
- name: Batch Test with Gradle | ||
run: | | ||
./gradlew batch:test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ services: | |
- TZ=Asia/Seoul | ||
command: [ "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--lower_case_table_names=1", "--max_connections=2048", "--wait_timeout=3600" ] | ||
ports: | ||
- "13306:3306" | ||
- "33306:3306" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 로컬 환경이 켜져있어도 테스트 수행할 수 있고 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이제 로컬에서 디비 컨태이너를 내리지 않고도 테스트가 가능하겠네요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네!!😃 |
||
volumes: | ||
- ./mysql-init.d:/docker-entrypoint-initdb.d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전체 테스트를 수행하는 경우에는 병렬로 실행할 수 있도록 -parallel 옵션 추가하였습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 이거 ㄹㅇ 굳굳