From 13e9f99b51e4be5175fdef9b0f87ca8a2aab1f6e Mon Sep 17 00:00:00 2001 From: jinsu4755 Date: Wed, 30 Aug 2023 17:06:08 +0900 Subject: [PATCH] chore: fix ci reuse script --- .github/workflows/gradle-task.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/pr_checker.yml | 12 +++--------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/gradle-task.yml b/.github/workflows/gradle-task.yml index b5cd4bb..6add8d0 100644 --- a/.github/workflows/gradle-task.yml +++ b/.github/workflows/gradle-task.yml @@ -5,5 +5,33 @@ jobs: needs: common runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.CI_TOKEN }} + submodules: true + + - name: Gradle cache + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Load GitHub submodule + run: ./gradlew copyConfig + - name: Run Gradle Task run: ./gradle ${{matrix.gradle.task}} \ No newline at end of file diff --git a/.github/workflows/pr_checker.yml b/.github/workflows/pr_checker.yml index 2df5e54..2bebf8c 100644 --- a/.github/workflows/pr_checker.yml +++ b/.github/workflows/pr_checker.yml @@ -11,17 +11,11 @@ permissions: pull-requests: write jobs: - checkstyle: - runs-on: ubuntu-latest + CheckStyle: strategy: matrix: - checkstyle: [ checkstyleMain, checkstyleTest ] - steps: - - name: load Common - uses: ./.github/workflows/common.yml - - - name: checkstyle - run: ./gradlew ${{matrix.checkstyle}} + gradle: [checkstyleMain, checkstyleTest] + uses: ./.github/workflows/gradle-task.yml # checkstyle: # needs: common