diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3561cf2..8ab4232 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,38 @@ on: - testing jobs: + unit_tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + - name: Run Unit Tests + run: ./gradlew testDebugUnitTest + + android_tests: + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + - name: Start Emulator and Run Instrumented Tests + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 29 + script: ./gradlew connectedDebugAndroidTest + build_and_release: runs-on: ubuntu-latest needs: [unit_tests, android_tests] steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -28,10 +54,7 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Build app - run: | - ./gradlew assembleProductionRelease - echo "Built APK files:" - find presentation/build/outputs/apk -name "*.apk" -type f + run: ./gradlew assembleProductionRelease env: KEYSTORE_PATH: ${{ github.workspace }}/key_store.jks RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }} @@ -43,7 +66,6 @@ jobs: - name: Create Release on GitHub uses: softprops/action-gh-release@v1 - if: github.ref == 'refs/heads/master' env: GITHUB_TOKEN: ${{ secrets.SHIORI_TOKEN }} with: