Skip to content

Commit

Permalink
[CHORE] Create ci_gradle.yml (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
JIN-076 authored Feb 18, 2024
1 parent 2df0517 commit 3053821
Showing 1 changed file with 78 additions and 0 deletions.
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'

0 comments on commit 3053821

Please sign in to comment.