テスト環境の整備: Unit Test CI編 #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Test | |
on: | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
unit-test: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
# TODO: 共通化させる | |
- name: setup JDK17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
# TODO: 共通化させる | |
- name: setup gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: wrapper | |
# TODO: 共通化させる | |
- name: setup local.properties | |
env: | |
API_TOKEN: ${{ secrets.API_TOKEN }} | |
run: | | |
echo "API_TOKEN=$API_TOKEN" >> local.properties | |
- name: setup detekt.properties | |
run: | | |
# disable autoCorrect | |
echo "autoCorrect=false" >> config/detekt/detekt.properties | |
- name: setup google-services.json | |
run: echo ${{ secrets.GOOGLE_SERVICES_JSON }} | base64 --decode > app/google-services.json | |
- run: cat app/google-services.json | |
- name: run unit test | |
run: ./gradlew testDebugUnitTest || true | |
#- name: publish unit test result | |
# if: always() | |
# uses: EnricoMi/publish-unit-test-result-action@v2 | |
# with: | |
# files: "**/build/test-results/**/*.xml" |