2023-02-13 10:39:58 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
merge_group:
|
2019-12-15 21:49:18 +00:00
|
|
|
|
|
|
|
name: Check pull request
|
2021-09-29 12:00:32 +00:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.head_ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-02-22 09:03:03 +00:00
|
|
|
env:
|
|
|
|
SENTRY_DSN: 'https://public_key@example.com/project_id'
|
|
|
|
|
2019-10-02 05:14:16 +00:00
|
|
|
jobs:
|
2022-10-29 02:56:46 +00:00
|
|
|
check-changed-files:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-04-13 17:22:28 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-10-29 02:56:46 +00:00
|
|
|
|
|
|
|
- name: Check if relevant files have changed
|
2023-04-06 16:17:57 +00:00
|
|
|
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
|
2022-10-29 02:56:46 +00:00
|
|
|
id: service-changed
|
|
|
|
with:
|
|
|
|
result-encoding: string
|
|
|
|
script: |
|
|
|
|
const script = require('.github/check-changed-files.js')
|
|
|
|
return await script({github, context})
|
|
|
|
|
|
|
|
- name: Fail if no files changed
|
|
|
|
if: "${{ steps.service-changed.outputs.result != 'true' }}"
|
|
|
|
shell: bash
|
|
|
|
run: exit 1
|
|
|
|
|
2021-12-07 10:06:41 +00:00
|
|
|
check-codestyle:
|
2022-10-29 02:56:46 +00:00
|
|
|
needs: [ "check-changed-files" ]
|
2021-05-22 13:17:09 +00:00
|
|
|
runs-on: ubuntu-latest
|
2019-10-02 05:14:16 +00:00
|
|
|
steps:
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Checkout repository
|
2023-04-13 17:22:28 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-05-27 22:11:27 +00:00
|
|
|
- name: Accept all SDK licenses
|
|
|
|
shell: bash
|
|
|
|
run: printf 'y\ny\ny\ny\ny\ny\n' | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
|
|
|
|
|
|
|
- name: Get build-tools directory
|
|
|
|
id: build-tools-path
|
|
|
|
shell: bash
|
|
|
|
run: echo "dir=${ANDROID_HOME}/build-tools/34.0.0-rc3" >> "${GITHUB_OUTPUT}"
|
|
|
|
|
|
|
|
- name: Cache build-tools
|
2023-05-28 04:33:26 +00:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2023-05-27 22:11:27 +00:00
|
|
|
with:
|
|
|
|
path: ${{ steps.build-tools-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-34.0.0-rc3
|
|
|
|
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Set up JDK
|
2023-03-27 19:27:47 +00:00
|
|
|
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 18
|
|
|
|
|
|
|
|
- name: Copy CI gradle.properties
|
|
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
|
|
|
|
- name: Check codestyle
|
2023-04-15 04:59:57 +00:00
|
|
|
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
arguments: ktfmtCheck
|
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
|
|
|
- name: Upload Kotlin build report
|
|
|
|
if: "${{ always() }}"
|
2023-01-06 15:39:49 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
name: Build report
|
|
|
|
path: build/reports/kotlin-build/
|
2021-12-07 10:06:41 +00:00
|
|
|
|
|
|
|
unit-tests:
|
2022-10-29 02:56:46 +00:00
|
|
|
needs: [ "check-changed-files" ]
|
2021-12-07 10:06:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Checkout repository
|
2023-04-13 17:22:28 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-05-27 22:11:27 +00:00
|
|
|
- name: Accept all SDK licenses
|
|
|
|
shell: bash
|
|
|
|
run: printf 'y\ny\ny\ny\ny\ny\n' | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
|
|
|
|
|
|
|
- name: Get build-tools directory
|
|
|
|
id: build-tools-path
|
|
|
|
shell: bash
|
|
|
|
run: echo "dir=${ANDROID_HOME}/build-tools/34.0.0-rc3" >> "${GITHUB_OUTPUT}"
|
|
|
|
|
|
|
|
- name: Cache build-tools
|
2023-05-28 04:33:26 +00:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2023-05-27 22:11:27 +00:00
|
|
|
with:
|
|
|
|
path: ${{ steps.build-tools-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-34.0.0-rc3
|
|
|
|
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Set up JDK
|
2023-03-27 19:27:47 +00:00
|
|
|
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 18
|
|
|
|
|
|
|
|
- name: Copy CI gradle.properties
|
|
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
|
|
|
|
- name: Run unit tests
|
2023-04-15 04:59:57 +00:00
|
|
|
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
arguments: test -PslimTests
|
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
|
|
|
- name: (Fail-only) Upload test report
|
|
|
|
if: "${{ failure() }}"
|
2023-01-06 15:39:49 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
2020-07-26 11:18:03 +00:00
|
|
|
name: Test report
|
|
|
|
path: app/build/reports
|
2021-12-07 10:06:41 +00:00
|
|
|
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Upload Kotlin build report
|
|
|
|
if: "${{ always() }}"
|
2023-01-06 15:39:49 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
name: Build report
|
|
|
|
path: build/reports/kotlin-build/
|
2022-06-10 17:57:56 +00:00
|
|
|
|
2021-12-07 10:06:41 +00:00
|
|
|
build-apks:
|
2022-10-29 02:56:46 +00:00
|
|
|
needs: [ "check-changed-files" ]
|
2021-12-07 10:06:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Checkout repository
|
2023-04-13 17:22:28 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-05-27 22:11:27 +00:00
|
|
|
- name: Accept all SDK licenses
|
|
|
|
shell: bash
|
|
|
|
run: printf 'y\ny\ny\ny\ny\ny\n' | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
|
|
|
|
|
|
|
- name: Get build-tools directory
|
|
|
|
id: build-tools-path
|
|
|
|
shell: bash
|
|
|
|
run: echo "dir=${ANDROID_HOME}/build-tools/34.0.0-rc3" >> "${GITHUB_OUTPUT}"
|
|
|
|
|
|
|
|
- name: Cache build-tools
|
2023-05-28 04:33:26 +00:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2023-05-27 22:11:27 +00:00
|
|
|
with:
|
|
|
|
path: ${{ steps.build-tools-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-34.0.0-rc3
|
|
|
|
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Set up JDK
|
2023-03-27 19:27:47 +00:00
|
|
|
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 18
|
|
|
|
|
|
|
|
- name: Copy CI gradle.properties
|
|
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
|
|
|
|
- name: Build debug APKs
|
2023-04-15 04:59:57 +00:00
|
|
|
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
2022-11-08 16:01:21 +00:00
|
|
|
arguments: assembleFreeDebug assembleNonFreeDebug assembleNonFreeRelease
|
2022-10-29 02:56:46 +00:00
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
|
|
|
- name: Upload Kotlin build report
|
|
|
|
if: "${{ always() }}"
|
2023-01-06 15:39:49 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
name: Build report
|
|
|
|
path: build/reports/kotlin-build/
|
2021-12-07 10:06:41 +00:00
|
|
|
|
|
|
|
check-api:
|
2022-10-29 02:56:46 +00:00
|
|
|
needs: [ "check-changed-files" ]
|
2021-12-07 10:06:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Checkout repository
|
2023-04-13 17:22:28 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-05-27 22:11:27 +00:00
|
|
|
- name: Accept all SDK licenses
|
|
|
|
shell: bash
|
|
|
|
run: printf 'y\ny\ny\ny\ny\ny\n' | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
|
|
|
|
|
|
|
- name: Get build-tools directory
|
|
|
|
id: build-tools-path
|
|
|
|
shell: bash
|
|
|
|
run: echo "dir=${ANDROID_HOME}/build-tools/34.0.0-rc3" >> "${GITHUB_OUTPUT}"
|
|
|
|
|
|
|
|
- name: Cache build-tools
|
2023-05-28 04:33:26 +00:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2023-05-27 22:11:27 +00:00
|
|
|
with:
|
|
|
|
path: ${{ steps.build-tools-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-34.0.0-rc3
|
|
|
|
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Set up JDK
|
2023-03-27 19:27:47 +00:00
|
|
|
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 18
|
|
|
|
|
|
|
|
- name: Copy CI gradle.properties
|
|
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
|
|
|
|
- name: Check library API
|
2023-04-15 04:59:57 +00:00
|
|
|
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
arguments: metalavaCheckCompatibilityRelease
|
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
|
|
|
- name: Upload Kotlin build report
|
|
|
|
if: "${{ always() }}"
|
2023-01-06 15:39:49 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
name: Build report
|
|
|
|
path: build/reports/kotlin-build/
|
2021-12-07 10:06:41 +00:00
|
|
|
|
|
|
|
lint-debug:
|
2022-10-29 02:56:46 +00:00
|
|
|
needs: [ "check-changed-files" ]
|
2021-12-07 10:06:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Checkout repository
|
2023-04-13 17:22:28 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-05-27 22:11:27 +00:00
|
|
|
- name: Accept all SDK licenses
|
|
|
|
shell: bash
|
|
|
|
run: printf 'y\ny\ny\ny\ny\ny\n' | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
|
|
|
|
|
|
|
- name: Get build-tools directory
|
|
|
|
id: build-tools-path
|
|
|
|
shell: bash
|
|
|
|
run: echo "dir=${ANDROID_HOME}/build-tools/34.0.0-rc3" >> "${GITHUB_OUTPUT}"
|
|
|
|
|
|
|
|
- name: Cache build-tools
|
2023-05-28 04:33:26 +00:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2023-05-27 22:11:27 +00:00
|
|
|
with:
|
|
|
|
path: ${{ steps.build-tools-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-34.0.0-rc3
|
|
|
|
|
2022-10-29 02:56:46 +00:00
|
|
|
- name: Set up JDK
|
2023-03-27 19:27:47 +00:00
|
|
|
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 18
|
|
|
|
|
|
|
|
- name: Copy CI gradle.properties
|
|
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
|
|
|
|
- name: Run Lint on debug variants
|
2023-04-15 04:59:57 +00:00
|
|
|
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
arguments: lintDebug
|
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
|
|
|
- name: Upload Kotlin build report
|
|
|
|
if: "${{ always() }}"
|
2023-01-06 15:39:49 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-10-29 02:56:46 +00:00
|
|
|
with:
|
|
|
|
name: Build report
|
|
|
|
path: build/reports/kotlin-build/
|
2022-07-17 08:37:50 +00:00
|
|
|
|
2023-04-27 09:12:11 +00:00
|
|
|
lint:
|
2022-10-29 02:56:46 +00:00
|
|
|
needs: [ "check-changed-files" ]
|
2022-07-17 08:37:50 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-04-13 17:22:28 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-07-17 08:37:50 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-05-27 22:11:27 +00:00
|
|
|
- name: Accept all SDK licenses
|
|
|
|
shell: bash
|
|
|
|
run: printf 'y\ny\ny\ny\ny\ny\n' | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
|
|
|
|
|
|
|
- name: Get build-tools directory
|
|
|
|
id: build-tools-path
|
|
|
|
shell: bash
|
|
|
|
run: echo "dir=${ANDROID_HOME}/build-tools/34.0.0-rc3" >> "${GITHUB_OUTPUT}"
|
|
|
|
|
|
|
|
- name: Cache build-tools
|
2023-05-28 04:33:26 +00:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2023-05-27 22:11:27 +00:00
|
|
|
with:
|
|
|
|
path: ${{ steps.build-tools-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-34.0.0-rc3
|
|
|
|
|
2022-07-17 08:37:50 +00:00
|
|
|
- name: Set up JDK
|
2023-03-27 19:27:47 +00:00
|
|
|
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
|
2022-07-17 08:37:50 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
2022-09-05 08:21:05 +00:00
|
|
|
java-version: 18
|
2022-07-17 08:37:50 +00:00
|
|
|
|
|
|
|
- name: Copy CI gradle.properties
|
|
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
|
2023-04-27 09:12:11 +00:00
|
|
|
- name: Run Lint
|
2023-04-15 04:59:57 +00:00
|
|
|
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
|
2022-07-17 08:37:50 +00:00
|
|
|
with:
|
2023-04-27 09:12:11 +00:00
|
|
|
arguments: lint
|
2022-08-30 16:38:46 +00:00
|
|
|
gradle-home-cache-cleanup: true
|
2022-07-17 08:37:50 +00:00
|
|
|
|
|
|
|
- name: Upload Kotlin build report
|
|
|
|
if: "${{ always() }}"
|
2023-01-06 15:39:49 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-07-17 08:37:50 +00:00
|
|
|
with:
|
|
|
|
name: Build report
|
|
|
|
path: build/reports/kotlin-build/
|