Skip to content

Commit

Permalink
docs: workflow를 생성한다.
Browse files Browse the repository at this point in the history
workflow: main
reusable workflow(jobs): build, test, dependency-submission
  • Loading branch information
min429 committed Jul 15, 2024
1 parent f3c8085 commit 69b9388
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up MySQL
uses: mirromutth/[email protected]
with:
host port: 3306
container port: 3306
character set server: 'utf8mb4'
collation server: 'utf8mb4_general_ci'
mysql version: '9.0'
mysql database: 'accompany'
mysql user: 'root'
mysql password: '1234'

- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build with Gradle Wrapper
run: ./gradlew build -s
22 changes: 22 additions & 0 deletions .github/workflows/dependency-submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: dependency-submission

on:
workflow_call:

jobs:
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Java CI/CD

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
JWT_ISSUER: dnd-11-1
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}

jobs:
build:
permissions:
contents: read
uses: ./.github/workflows/build.yml

test:
permissions:
contents: read
uses: ./.github/workflows/test.yml

dependency-submission:
permissions:
contents: write
uses: ./.github/workflows/dependency-submission.yml
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: test

on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up MySQL
uses: mirromutth/[email protected]
with:
host port: 3306
container port: 3306
character set server: 'utf8mb4'
collation server: 'utf8mb4_general_ci'
mysql version: '9.0'
mysql database: 'accompany'
mysql user: 'root'
mysql password: '1234'

- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: test with Gradle Wrapper
run: ./gradlew test -s

0 comments on commit 69b9388

Please sign in to comment.