Bump gradle-update/update-gradle-wrapper-action from 1 to 2 #32
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: Code Quality Checks | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- '**' | |
paths: | |
- '.github/workflows/**' | |
- 'AnkiDroid/**' | |
- 'api/**' | |
- 'lint-rules/**' | |
- 'annotations/**' | |
- '**/*.gradle' | |
- 'gradle/**' | |
push: | |
branches: | |
- main | |
- i18n_sync | |
- dependency-updates | |
- 'release**' | |
paths: | |
- '.github/workflows/**' | |
- 'AnkiDroid/**' | |
- 'api/**' | |
- 'lint-rules/**' | |
- 'annotations/**' | |
- '**/*.gradle' | |
- 'gradle/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lintDebug: | |
name: Lint Debug | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Configure JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "11" # ubuntu-latest is about to default to 11, force it everywhere | |
- name: Verify JDK11 | |
# Default JDK varies depending on different runner flavors, make sure we are on 11 | |
# Run a check that exits with error unless it is 11 version to future-proof against unexpected upgrades | |
run: java -fullversion 2>&1 | grep '11.0' | |
shell: bash | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
timeout-minutes: 5 | |
with: | |
# Only write to the cache for builds on the 'main' branches, stops branches evicting main cache | |
# Builds on other branches will only read from main branch cache writes | |
# Comment this and the with: above out for performance testing on a branch | |
cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
- name: Warm Gradle Cache | |
# This makes sure we fetch gradle network resources with a retry | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 10 | |
retry_wait_seconds: 60 | |
max_attempts: 3 | |
command: ./gradlew :AnkiDroid:compilePlayDebugJavaWithJavac compileLint lint-rules:compileTestJava --daemon | |
- name: Run Lint Debug | |
uses: gradle/gradle-build-action@v2 | |
with: | |
# "lint" is run under the 'Amazon' flavor, so slow in CI | |
# "lintPlayRelease" doesn't test androidTest | |
# "lintPlayDebug" doesn't test the API | |
arguments: lintPlayDebug :api:lintDebug ktLintCheck lint-rules:test --daemon | |
- name: Prettify code | |
uses: creyD/[email protected] | |
with: | |
prettier_options: --check AnkiDroid/**/*.js | |
dry: True |