ci: add initial github actions pipelines

This commit is contained in:
Arun Babu Neelicattu 2021-03-25 12:26:26 +01:00 committed by Benoit Marty
parent 57fd580124
commit ff1d8c310e
3 changed files with 144 additions and 0 deletions

59
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: Build
on:
pull_request: {}
push:
branches: [master, develop]
jobs:
debug:
name: Build debug APK (${{ matrix.target }})
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
strategy:
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: Assemble ${{ matrix.target }} debug apk
run: ./gradlew clean lint${{ matrix.target }}Release assemble${{ matrix.target }}Debug --stacktrace
- name: Upload APKs
uses: actions/upload-artifact@v2
with:
name: release-debug-${{ matrix.target }}
path: |
vector/build/outputs/apk/*/debug/*.apk
vector/build/reports/*.*
gplay:
name: Build unsigned GPlay APK
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
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: Assemble GPlay unsigned apk
run: ./gradlew clean assembleGplayRelease --stacktrace
- name: Upload APKs
uses: actions/upload-artifact@v2
with:
name: release-unsigned-GPlay
path: |
vector/build/outputs/apk/*/debug/*.apk
# TODO: add exodus checks

46
.github/workflows/quality.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: Code Quality Checks
on:
pull_request: {}
push:
branches: [master, develop]
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:
name: report-lint-andorid-sdk
path: matrix-sdk-android/build/reports/*.*

39
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Test
on:
pull_request: {}
push:
branches: [master, develop]
jobs:
unit-tests:
name: Unit Tests
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: Run unit tests
run: ./gradlew clean test --stacktrace -PallWarningsAsErrors=false
android-tests:
name: Android Tests
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: Run android tests
run: ./gradlew clean assembleAndroidTest --stacktrace -PallWarningsAsErrors=false