Skip to content

テスト環境の整備: Unit Test CI編 #8

テスト環境の整備: Unit Test CI編

テスト環境の整備: Unit Test CI編 #8

Workflow file for this run

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
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON | base64 --decode > app/google-services.json
- name: run unit test
run: ./gradlew testDebugUnitTest || true
- run: find **/build/test-results -type f -name "*.xml" -print
#- name: publish unit test result
# if: always()
# uses: EnricoMi/publish-unit-test-result-action@v2
# with:
# files: "**/build/test-results/**/*.xml"