Skip to content

131 add spring rest docs #67

131 add spring rest docs

131 add spring rest docs #67

Workflow file for this run

## Use codecov, and not Continuous Deployment & Delivery
name: Code Coverage in main, develop branch
on:
pull_request:
branches: [ "main", "develop" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:4.4
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 27017:27017
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: menjil-test
MYSQL_ROOT_PASSWORD: root
# MYSQL_USER: root
# MYSQL_PASSWORD: root33
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
# workflow 실행 전 기본적으로 checkout 필요
# 최신 버전은 v3
- uses: actions/checkout@v3
- name: Install Ubuntu dependencies
run: sudo apt-get update
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin' # jdk를 제공하는 vender사 이름 ex. zulu, adopt, microsoft
## Create secret yml files before build
- name: create application-common, local, prod, test.yml
shell: bash
run: |
touch ./src/main/resources/application-common.yml
echo "${{secrets.APPLICATION_COMMON}}" > ./src/main/resources/application-common.yml
touch ./src/main/resources/application-local.yml
echo "${{secrets.APPLICATION_LOCAL}}" > ./src/main/resources/application-local.yml
touch ./src/main/resources/application-prod.yml
echo "${{secrets.APPLICATION_PROD}}" > ./src/main/resources/application-prod.yml
touch ./src/main/resources/application-test.yml
echo "${{secrets.APPLICATION_TEST}}" > ./src/main/resources/application-test.yml
## Gradle
- name: Cache gradle packages
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: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Verify MySQL connection
run: |
sleep 30
mysql --host 127.0.0.1 --port 3306 --user root --password=root -e "SHOW DATABASES;"
## Build
- name: Build with Gradle
run: ./gradlew clean build
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./build/reports/jacoco/test/jacocoTestReport.xml
# code-coverage:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}