CI #935
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
# SPDX-FileCopyrightText: 2017-2024 Alexey Rochev <equeim@gmail.com> | |
# | |
# SPDX-License-Identifier: CC0-1.0 | |
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
jobs: | |
build-app: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Add Kotlin problem matcher | |
uses: equeim/kotlin-problem-matcher@v1 | |
- name: Set up Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Validate Gradle wrapper | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
cache-read-only: ${{ github.event_name == 'pull_request' }} | |
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
- name: Build the app | |
run: | | |
./gradlew build | |
- name: Archive debug APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debug-apk | |
path: app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk | |
retention-days: ${{ github.event_name == 'pull_request' && 3 || github.retention_days }} | |
- name: Archive unsigned release APKs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: unsigned-release-apks | |
path: app/build/outputs/apk/*/release/*.apk | |
retention-days: ${{ github.event_name == 'pull_request' && 3 || github.retention_days }} | |
- name: Archive test and lint reports | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: reports | |
path: | | |
app/build/reports/* | |
billing/build/reports/* | |
common/build/reports/* | |
rpc/build/reports/* | |
torrentfile/build/reports/* | |
retention-days: ${{ github.event_name == 'pull_request' && 3 || github.retention_days }} | |
reuse-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Check REUSE compliance | |
run: | | |
sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends --assume-yes install pipx | |
pipx run reuse lint |