Repository navigation
Custom AI keys: change the selection only when inserting the result #210
Workflow file for this run
This file contains hidden or 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: Test build | |
| # builds only for a single abi and does not produce an APK | |
| on: | |
| # disabled on push: when I push to non-main, I do a PR anyway | |
| # push: | |
| # don't run on main. I noticed I often don't push commits to avoid unnecessary workflow runs | |
| # branches-ignore: [ main ] | |
| # paths: | |
| # - 'app/**' | |
| pull_request: | |
| paths: | |
| - 'app/src/main/java**' | |
| - 'app/src/standard/**' | |
| - 'app/src/offline/**' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # PR merge commit plus its parents, to list the files the PR changes | |
| fetch-depth: 2 | |
| # docs/FEATURES.md holds a settings map generated from the settings code; fail fast when a | |
| # settings change leaves it (or a "Settings → ..." path in the docs) out of date | |
| - name: Check settings map in docs | |
| run: python3 tools/generate_settings_map.py --check | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - uses: gradle/actions/setup-gradle@v4 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| # Each flavor compiles the main sources again, so build only the flavors the PR touches: | |
| # offline sources -> offline, anything else (main, standard) -> standard. Manual runs build both. | |
| - name: Build with Gradle | |
| run: | | |
| if [ "${{ github.event_name }}" != "pull_request" ]; then | |
| TASKS="compileStandardRunTestsKotlin compileOfflineRunTestsKotlin" | |
| else | |
| CHANGED=$(git diff --name-only HEAD^1 HEAD | grep '^app/src/' || true) | |
| TASKS="" | |
| if echo "$CHANGED" | grep -qv '^app/src/offline/'; then TASKS="compileStandardRunTestsKotlin"; fi | |
| if echo "$CHANGED" | grep -q '^app/src/offline/'; then TASKS="$TASKS compileOfflineRunTestsKotlin"; fi | |
| [ -n "$TASKS" ] || TASKS="compileStandardRunTestsKotlin" | |
| fi | |
| echo "Building: $TASKS" | |
| ./gradlew $TASKS | |
| - name: Archive reports for failed job | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reports | |
| path: '*/build/reports' | |
| if: ${{ failure() }} |