diff --git a/.github/workflows/pr-bot.yml b/.github/workflows/pr-bot.yml new file mode 100644 index 00000000..8ea66414 --- /dev/null +++ b/.github/workflows/pr-bot.yml @@ -0,0 +1,69 @@ +name: Java Spring Build Checker + +on: + pull_request: + paths: + - 'server/src/**' + - 'server/build.gradle' + branches: + - develop + workflow_dispatch: + inputs: + comment: + description: '수동 trigger 사유' + default: 'ex) 서버 설정 변경 등' + +permissions: + checks: write + pull-requests: write + +jobs: + build: + name: Build check + runs-on: ubuntu-latest + env: + working-directory: server + steps: + - name: Checkout the code + uses: actions/checkout@v3 + + - 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: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'corretto' + cache: 'gradle' + + - name: Setup MySQL + uses: mirromutth/mysql-action@v1.1 + with: + mysql database: 'talkka_db' + mysql user: ${{ secrets.MYSQL_USERNAME }} + mysql password: ${{ secrets.MYSQL_PASSWORD }} + + - name: Make application.yaml + run: | + cd ./src/main/resources + touch ./application.yaml + + echo "${{ secrets.APPLICATION_YAML }}" >> ./application.yaml + shell: bash + working-directory: ${{ env.working-directory }} + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + working-directory: ${{ env.working-directory }} + + - name: Build with Gradle + run: ./gradlew clean build --debug --exclude-task test + working-directory: ${{ env.working-directory }} \ No newline at end of file diff --git a/server/src/main/java/com/talkka/server/oauth/OAuth2LoginFailureHandler.java b/server/src/main/java/com/talkka/server/oauth/OAuth2LoginFailureHandler.java index 9276b78f..5951e25b 100644 --- a/server/src/main/java/com/talkka/server/oauth/OAuth2LoginFailureHandler.java +++ b/server/src/main/java/com/talkka/server/oauth/OAuth2LoginFailureHandler.java @@ -22,4 +22,4 @@ public void onAuthenticationFailure(HttpServletRequest request, HttpServletRespo setDefaultFailureUrl(defaultFailureUrl); super.onAuthenticationFailure(request, response, exception); } -} \ No newline at end of file +} diff --git a/server/src/main/java/com/talkka/server/oauth/domain/CustomUserPrincipal.java b/server/src/main/java/com/talkka/server/oauth/domain/CustomUserPrincipal.java index 1876dc38..22c1c32e 100644 --- a/server/src/main/java/com/talkka/server/oauth/domain/CustomUserPrincipal.java +++ b/server/src/main/java/com/talkka/server/oauth/domain/CustomUserPrincipal.java @@ -31,4 +31,4 @@ public Collection getAuthorities() { public String getName() { return user.getName(); } -} \ No newline at end of file +}