Skip to content
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

[CHORE] CI 자동화 구축 #18

Merged
merged 1 commit into from
Feb 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/ci_gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle in mogakGo

on:
workflow_dispatch:
push:
branches: [ "develop" ]
pull_request:
branches: [ "main", "develop" ]

permissions:
checks: write
pull-requests: write

jobs:
build:

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'

## Gradle Wrapper grant permission
- name: Grant execute permission for gradlew
run: chmod +x gradlew

## create application.yml
- name: make application.yml
run: |
mkdir -p ./src/main/resources
touch ./src/main/resources/application.yml
shell: bash

- name: save application.yml for secrets
run: echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.yml
shell: bash

## create test_application.yml
- name: make test_application.yml
run: |
mkdir -p ./src/test/resources
touch ./src/test/resources/application.yml
shell: bash

- name: save test_application.yml for secrets
run: echo "${{ secrets.APPLICATION_TEST }}" > ./src/test/resources/application.yml
shell: bash

## create test_ddl.sql for test

## execute Gradle test
- name: Test with Gradle
run: ./gradlew --info test

## create Report after Test
- name: Public Test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: '**/build/test-results/test/TEST-*.xml'

## make comment about error
- name: add comments to pull-request
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
Loading