2021-03-25 14:26:26 +03:00
|
|
|
name: Code Quality Checks
|
|
|
|
|
|
|
|
on:
|
2021-03-26 23:19:48 +03:00
|
|
|
pull_request: { }
|
2021-03-25 14:26:26 +03:00
|
|
|
push:
|
2021-05-06 19:25:34 +03:00
|
|
|
branches: [ main, develop ]
|
2021-03-25 14:26:26 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
name: Project Check Suite
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Run code quality check suite
|
|
|
|
run: ./tools/check/check_code_quality.sh
|
|
|
|
|
2021-10-07 11:36:38 +03:00
|
|
|
ktlint:
|
2021-03-25 14:26:26 +03:00
|
|
|
name: Kotlin Linter
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-10-07 11:36:38 +03:00
|
|
|
- name: Run ktlint
|
2021-03-25 14:26:26 +03:00
|
|
|
run: |
|
2021-10-01 14:28:47 +03:00
|
|
|
./gradlew ktlintCheck --continue
|
|
|
|
- name: Upload reports
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ktlinting-report
|
|
|
|
path: vector/build/reports/ktlint/*.*
|
2021-03-25 14:26:26 +03:00
|
|
|
|
2021-09-03 10:42:53 +03:00
|
|
|
# Lint for main module and all the other modules
|
2021-03-25 14:26:26 +03:00
|
|
|
android-lint:
|
|
|
|
name: Android Linter
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
2021-09-02 11:42:56 +03:00
|
|
|
- name: Lint analysis
|
|
|
|
run: ./gradlew clean :vector:lint --stacktrace
|
2021-03-25 14:26:26 +03:00
|
|
|
- name: Upload reports
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-09-02 11:42:56 +03:00
|
|
|
name: lint-report
|
2021-03-26 23:19:48 +03:00
|
|
|
path: |
|
|
|
|
vector/build/reports/*.*
|
2021-09-03 10:42:53 +03:00
|
|
|
|
|
|
|
# Lint for Gplay and Fdroid release APK
|
|
|
|
apk-lint:
|
|
|
|
name: Lint APK (${{ matrix.target }})
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.ref != 'refs/heads/main'
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target: [ Gplay, Fdroid ]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Lint ${{ matrix.target }} release
|
|
|
|
run: ./gradlew clean lint${{ matrix.target }}Release --stacktrace
|
|
|
|
- name: Upload ${{ matrix.target }} linting report
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: release-lint-report-${{ matrix.target }}
|
|
|
|
path: |
|
|
|
|
vector/build/reports/*.*
|