Skip to content

chore: ci MySQL 변경 #16

chore: ci MySQL 변경

chore: ci MySQL 변경 #16

Workflow file for this run

name: CI
permissions:
checks: write
pull-requests: write
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: touch ./src/main/resources/application-oauth.properties
- run: echo "${{ secrets.APPLICATION_OAUTH }}" > ./src/main/resources/application-oauth.properties
- run: cat ./src/main/resources/application-oauth.properties
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
- name: Start MySQL
uses: samin/mysql-action@v1.3
with:
character set server: "utf8"
mysql database: "milkweb"
mysql root password: ${{secrets.MY_SQL_PWD}}
- name: Test MySQL Connection
run: |
mysql -h 127.0.0.1 -u root -p${{secrets.MY_SQL_PWD}} -e "SELECT 1;"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build
# 테스트 후 Result를 보기위해 Publish Unit Test Results step 추가
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: ${{ always() }} # 테스트가 실패하여도 Report를 보기 위해 `always`로 설정
with:
files: build/test-results/**/*.xml