Skip to content
Merged
Show file tree
Hide file tree
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
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: log4u-build
on:
# push:
# branches:
# - dev # dev 브랜치 push
pull_request:
branches:
- main # main pr
types: [ opened, synchronize, reopened ]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu' # Alternative distribution options are available
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DB_URL: ${{ secrets.DB_URL }} # Database URL
DB_USERNAME: ${{ secrets.DB_USERNAME }} # Database username
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} # Database password
run: |
chmod +x ./gradlew
./gradlew build jacocoTestReport sonar --info
28 changes: 28 additions & 0 deletions .github/workflows/daily-archive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Archive dev branch daily

on:
schedule:
- cron: "59 14 * * *" # 한국 시간(KST) 23:59 (UTC+14:59)
workflow_dispatch: # 수동 실행 가능

jobs:
archive:
name: Archive dev branch
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # 모든 브랜치 가져오기

- name: Set archive branch name
id: date
run: echo "BRANCH_NAME=archive-$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Create new archive branch
run: |
git checkout dev
git pull origin dev
git checkout -b ${{ env.BRANCH_NAME }}
git push origin ${{ env.BRANCH_NAME }}