2021-03-25 12:26:26 +01:00
|
|
|
name: Code Quality Checks
|
|
|
|
|
|
|
|
on:
|
2021-03-26 21:19:48 +01:00
|
|
|
pull_request: { }
|
2021-03-25 12:26:26 +01:00
|
|
|
push:
|
2021-05-06 18:25:34 +02:00
|
|
|
branches: [ main, develop ]
|
2021-03-25 12:26:26 +01: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
|
|
|
|
|
|
|
|
klint:
|
|
|
|
name: Kotlin Linter
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Run klint
|
|
|
|
run: |
|
|
|
|
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.36.0/ktlint && chmod a+x ktlint
|
|
|
|
./ktlint --android --experimental -v
|
|
|
|
|
|
|
|
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-
|
|
|
|
- name: Lint analysis of the SDK
|
|
|
|
run: ./gradlew clean :matrix-sdk-android:lintRelease --stacktrace
|
|
|
|
- name: Upload reports
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-03-25 13:55:01 +01:00
|
|
|
name: linting-report-android-sdk
|
2021-03-25 12:26:26 +01:00
|
|
|
path: matrix-sdk-android/build/reports/*.*
|
2021-03-26 21:19:48 +01:00
|
|
|
|
|
|
|
apk-lint:
|
|
|
|
name: Lint APK (${{ matrix.target }})
|
|
|
|
runs-on: ubuntu-latest
|
2021-05-06 18:25:34 +02:00
|
|
|
if: github.ref != 'refs/heads/main'
|
2021-03-26 21:19:48 +01:00
|
|
|
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-debug-linting-report-${{ matrix.target }}
|
|
|
|
path: |
|
|
|
|
vector/build/reports/*.*
|