Stale credits notified as PR comment #107
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: Build & Test | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'website/**' | |
- 'fastlane/**' | |
- 'assets/**' | |
- '**/*.md' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
# run on macOS to use Skiko mac for credits checks | |
runs-on: macos-latest | |
permissions: | |
contents: read | |
checks: write | |
id-token: write | |
pull-requests: 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: ©️ Generate credits for ':tasks-app-desktop' | |
id: check_desktop_app_credits | |
run: | | |
# ./gradlew --no-daemon :tasks-app-desktop:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/resources | |
stale_credits="aaaa\nbbbb\ncccc" # $(git diff tasks-app-desktop/src/main/resources/licenses_desktop.json) | |
echo "stale_credits='$stale_credits'" | |
if [ -n "${stale_credits}" ]; then | |
./_ci/generate_github_comment_stale_credits.sh ":tasks-app-desktop" >> "${GITHUB_STEP_SUMMARY}" | |
# echo ::set-output name=credits_diff::$(./_ci/generate_github_comment_stale_credits.sh ":tasks-app-desktop") | |
# credits_diff=$(./_ci/generate_github_comment_stale_credits.sh ":tasks-app-desktop") | |
echo "HAS STALE" | |
echo "credits_state=stale" >> "${GITHUB_OUTPUT}" | |
# echo 'credits_diff<<EOF' >> "${GITHUB_OUTPUT}" | |
# ./_ci/generate_github_comment_stale_credits.sh ":tasks-app-desktop" >> "${GITHUB_OUTPUT}" | |
# echo 'EOF' >> "${GITHUB_OUTPUT}" | |
{ | |
echo 'credits_diff<<EOF' | |
./_ci/generate_github_comment_stale_credits.sh ":tasks-app-desktop" | |
echo EOF | |
} >> "${GITHUB_OUTPUT}" | |
else | |
echo "NO STALE" | |
echo "credits_state=ok" >> "${GITHUB_OUTPUT}" | |
fi | |
- name: 🛎️ Notify stale credits for ':tasks-app-desktop' | |
if: steps.check_desktop_app_credits.outputs.credits_state != 'ok' | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '${{ steps.check_desktop_app_credits.outputs.credits_diff }}' | |
}) | |
# - name: 🔨 Build Desktop App 🖥️ | |
# run: ./gradlew --no-daemon :tasks-app-desktop:assemble | |
- name: ©️ Generate credits for ':tasks-app-android' | |
id: check_android_app_credits | |
run: | | |
# ./gradlew --no-daemon :tasks-app-android:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/assets | |
stale_credits="" #$(git diff tasks-app-android/src/main/assets/licenses_android.json) | |
echo "stale_credits='$stale_credits'" | |
if [ -n "${stale_credits}" ]; then | |
echo "HAS STALE" | |
./_ci/generate_github_comment_stale_credits.sh ":tasks-app-android" >> "${GITHUB_STEP_SUMMARY}" | |
echo "credits_state=stale" >> "${GITHUB_OUTPUT}" | |
else | |
echo "NO STALE" | |
echo "credits_state=ok" >> "${GITHUB_OUTPUT}" | |
fi | |
- name: 🛎️ Notify stale credits for ':tasks-app-android' | |
uses: actions/github-script@v7 | |
if: steps.check_android_app_credits.outputs.credits_state != 'ok' | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'test ANDROID ${{ steps.check_android_app_credits.outputs.credits_state != 'ok' }} ${{ steps.check_android_app_credits.outputs.credits_state }}' | |
}) | |
# - name: 🔨 Build Android App 📱 | |
# 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-android:assembleStoreRelease \ | |
# -Pci=true \ | |
# -Pplaystore.keystore.file="${PWD}/_ci/tasksApp.keystore" \ | |
# -Pplaystore.keystore.password="${KEYSTORE_PASSWORD}" \ | |
# -Pplaystore.keystore.key_password="${KEYSTORE_KEY_PASSWORD}" | |
# # `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' |