Merge pull request #64 from usbharu/github-action

chore: GitHub Actionの改善
This commit is contained in:
usbharu 2023-09-30 14:51:14 +09:00 committed by GitHub
commit b94404258e
2 changed files with 62 additions and 10 deletions

View File

@ -13,6 +13,7 @@ on:
permissions:
contents: read
pull-requests: write
jobs:
lint:
@ -21,6 +22,29 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3.3.2
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache
uses: actions/cache@v3.3.2
with:
path: |
~/.gradle/caches/jars-*
~/.gradle/caches/transforms-*
~/.gradle/caches/modules-*
key: gradle-dependencies-${{ steps.cache-key.outputs.week }}-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: gradle-dependencies-${{ steps.cache-key.outputs.week }}-
- name: Cache
uses: actions/cache@v3.3.2
with:
path: |
~/.gradle/caches/build-cache-*
~/.gradle/caches/[0-9]*.*
.gradle
key: ${{ runner.os }}-gradle-build-${{ github.workflow }}-${{ steps.cache-key.outputs.week }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-gradle-build-${{ github.workflow }}-${{ steps.cache-key.outputs.week }}-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
@ -30,3 +54,7 @@ jobs:
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: detektMain
- name: "reviewdog-suggester: Suggest any code changes based on diff with reviewdog"
uses: reviewdog/action-suggester@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -21,12 +21,36 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3.3.2
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache
uses: actions/cache@v3.3.2
with:
path: |
~/.gradle/caches/jars-*
~/.gradle/caches/transforms-*
~/.gradle/caches/modules-*
key: gradle-dependencies-${{ steps.cache-key.outputs.week }}-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: gradle-dependencies-${{ steps.cache-key.outputs.week }}-
- name: Cache
uses: actions/cache@v3.3.2
with:
path: |
~/.gradle/caches/build-cache-*
~/.gradle/caches/[0-9]*.*
.gradle
key: ${{ runner.os }}-gradle-build-${{ github.workflow }}-${{ steps.cache-key.outputs.week }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-gradle-build-${{ github.workflow }}-${{ steps.cache-key.outputs.week }}-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
- name: Gradle Build Action
uses: gradle/gradle-build-action@v2.8.1
with:
arguments: test