199 lines
5.3 KiB
YAML
199 lines
5.3 KiB
YAML
name: Test/Build
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 21
|
|
|
|
- name: Cache gradle
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Linter (gradle)
|
|
run: ./gradlew spotlessCheck
|
|
|
|
test:
|
|
needs: lint
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 30
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 21
|
|
|
|
- name: Cache gradle
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Test (gradle)
|
|
run: ./gradlew test --no-daemon
|
|
|
|
- name: Android Test Report
|
|
uses: asadmansr/android-test-report-action@v1.2.0
|
|
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
|
|
|
|
- name: Upload Test Results
|
|
uses: actions/upload-artifact@v6
|
|
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
|
|
with:
|
|
name: Test Reports
|
|
path: amethyst/build/reports
|
|
|
|
build-android:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 21
|
|
|
|
- name: Cache gradle
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Build APK (gradle)
|
|
run: ./gradlew assembleDebug
|
|
|
|
- name: Upload Play APK
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: Play Debug APK
|
|
path: amethyst/build/outputs/apk/play/debug/amethyst-play-universal-debug.apk
|
|
|
|
- name: Upload FDroid APK
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: FDroid Debug APK
|
|
path: amethyst/build/outputs/apk/fdroid/debug/amethyst-fdroid-universal-debug.apk
|
|
|
|
- name: Build Benchmark APK (gradle)
|
|
run: ./gradlew assembleBenchmark
|
|
|
|
- name: Upload Play APK Benchmark
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: Play Benchmark APK
|
|
path: amethyst/build/outputs/apk/play/benchmark/amethyst-play-universal-benchmark.apk
|
|
|
|
- name: Upload FDroid APK Benchmark
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: FDroid Benchmark APK
|
|
path: amethyst/build/outputs/apk/fdroid/benchmark/amethyst-fdroid-universal-benchmark.apk
|
|
|
|
- name: Upload Compose Reports
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: Compose Reports
|
|
path: amethyst/build/compose_compiler
|
|
|
|
build-desktop:
|
|
needs: test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
task: packageDeb
|
|
artifact-name: Desktop Linux DEB
|
|
artifact-path: desktopApp/build/compose/binaries/main/deb/*.deb
|
|
- os: macos-latest
|
|
task: packageDmg
|
|
artifact-name: Desktop macOS DMG
|
|
artifact-path: desktopApp/build/compose/binaries/main/dmg/*.dmg
|
|
- os: windows-latest
|
|
task: packageMsi
|
|
artifact-name: Desktop Windows MSI
|
|
artifact-path: desktopApp/build/compose/binaries/main/msi/*.msi
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 30
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 21
|
|
|
|
- name: Cache gradle
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Build Desktop Distribution
|
|
run: ./gradlew :desktopApp:${{ matrix.task }}
|
|
|
|
- name: Upload Desktop Distribution
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: ${{ matrix.artifact-name }}
|
|
path: ${{ matrix.artifact-path }}
|