Skip to content

Licenses information gathering & About screen (closes #41) #42

Licenses information gathering & About screen (closes #41)

Licenses information gathering & About screen (closes #41) #42

Workflow file for this run

name: Build & Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: ☕ Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: 🐘 Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
add-job-summary-as-pr-comment: on-failure
- name: 🔓 Decrypt secrets
env:
PLAYSTORE_SECRET_PASSPHRASE: ${{ secrets.PLAYSTORE_SECRET_PASSPHRASE }}
run: ./_ci/decrypt_secrets.sh
- name: 🔨 Build Desktop App 🖥️
id: desktop_app_build
run: |
./gradlew --no-daemon :tasks-app-desktop:exportLibraryDefinitions :tasks-app-desktop:assemble \
-PaboutLibraries.exportPath=src/main/resources
echo ::set-output name=stale_credits::$(git diff tasks-app-desktop/src/main/resources/licenses_desktop.json)
- name: 🛎️ Notify stale ':tasks-app-desktop' ©️ credits
if: github.event_name == 'pull_request' && steps.desktop_app_build.outputs.stale_credits != ''
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '${{ steps.desktop_app_build.outputs.stale_android_app_credits }}'
})
- name: 🔨 Build Android App 📱
id: android_app_build
env:
PLAYSTORE_SECRET_PASSPHRASE: ${{ secrets.PLAYSTORE_SECRET_PASSPHRASE }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
run: |
./gradlew --no-daemon :tasks-app-desktop:exportLibraryDefinitions :tasks-app-android:assembleStoreRelease \
-PaboutLibraries.exportPath=src/main/assets \
-Pci=true \
-Pplaystore.keystore.file="${PWD}/_ci/tasksApp.keystore" \
-Pplaystore.keystore.password="${KEYSTORE_PASSWORD}" \
-Pplaystore.keystore.key_password="${KEYSTORE_KEY_PASSWORD}"
echo ::set-output name=stale_credits::$(git diff tasks-app-android/src/main/assets/licenses_android.json)
- name: 🛎️ Notify stale ':tasks-app-android' ©️ credits
if: github.event_name == 'pull_request' && steps.android_app_build.outputs.stale_credits != ''
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '${{ steps.android_app_build.outputs.stale_android_app_credits }}'
})
# `test` to trigger as much Jvm tests as possible
# `:tasks-app-android:testStoreReleaseUnitTest` to restrict to only specific flavor(store)+variant(release) for `:tasks-app-android` module.
# `-x :tasks-app-android:test` to remove all tests from `:tasks-app-android` module not being covered by `:tasks-app-android:testStoreReleaseUnitTest`.
# `-x testDebugUnitTest` to avoid triggering tests both in debug & release build.
# `-x :tasks-app-android:build` to avoid triggering useless build tasks (typically for unused flavors).
# Only rely on dependencies of `:tasks-app-android:testStoreReleaseUnitTest`.
- name: ✅ Test
run: |
./gradlew --no-daemon test :tasks-app-android:testStoreReleaseUnitTest \
-x :tasks-app-android:test -x testDebugUnitTest -x :tasks-app-android:build
- name: 🗒️ Publish Test Reports
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'