mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-14 22:05:39 +02:00
Trim after removing inline timestamps before matching speaker prefixes in Dart. Run one 21-case usability corpus through Dart, Go, and Kotlin tests. Document the shared fixture and trigger Dart and Go CI when its resources change.
187 lines
5.3 KiB
YAML
187 lines
5.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
changes:
|
|
name: Detect changed paths
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: read
|
|
outputs:
|
|
dart: ${{ steps.filter.outputs.dart }}
|
|
go: ${{ steps.filter.outputs.go }}
|
|
android: ${{ steps.filter.outputs.android }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
|
|
- name: Filter paths
|
|
uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
dart:
|
|
- 'lib/**'
|
|
- 'test/**'
|
|
- 'android/app/src/test/resources/**'
|
|
- 'assets/**'
|
|
- 'pubspec.yaml'
|
|
- 'pubspec.lock'
|
|
- 'analysis_options.yaml'
|
|
- 'l10n.yaml'
|
|
- '.fvmrc'
|
|
- '.github/workflows/ci.yml'
|
|
go:
|
|
- 'go_backend/**'
|
|
- 'android/app/src/test/resources/**'
|
|
- '.github/workflows/ci.yml'
|
|
android:
|
|
- 'android/**'
|
|
- 'go_backend/**'
|
|
- 'lib/models/settings.dart'
|
|
- 'lib/providers/download_queue_provider*.dart'
|
|
- 'lib/services/download_request_payload.dart'
|
|
- 'lib/services/history_database.dart'
|
|
- 'lib/services/platform_bridge.dart'
|
|
- 'pubspec.yaml'
|
|
- 'pubspec.lock'
|
|
- '.fvmrc'
|
|
- '.github/workflows/ci.yml'
|
|
|
|
flutter:
|
|
name: Flutter analyze & test
|
|
runs-on: ubuntu-latest
|
|
needs: changes
|
|
if: needs.changes.outputs.dart == 'true'
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
|
|
with:
|
|
channel: "stable"
|
|
flutter-version-file: .fvmrc
|
|
cache: true
|
|
|
|
- name: Cache pub dependencies
|
|
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
|
|
with:
|
|
path: ~/.pub-cache
|
|
key: pub-${{ runner.os }}-${{ hashFiles('pubspec.lock') }}
|
|
restore-keys: pub-${{ runner.os }}-
|
|
|
|
- name: Get Flutter dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Analyze
|
|
run: flutter analyze
|
|
|
|
- name: Run tests
|
|
run: flutter test
|
|
|
|
go:
|
|
name: Go vet & test
|
|
runs-on: ubuntu-latest
|
|
needs: changes
|
|
if: needs.changes.outputs.go == 'true'
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: go_backend
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
|
|
with:
|
|
go-version-file: go_backend/go.mod
|
|
cache-dependency-path: go_backend/go.sum
|
|
|
|
- name: Check formatting
|
|
run: test -z "$(gofmt -l .)"
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Run tests
|
|
run: go test ./...
|
|
|
|
android:
|
|
name: Android compile & native tests
|
|
runs-on: ubuntu-latest
|
|
needs: changes
|
|
if: needs.changes.outputs.android == 'true'
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "25"
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
|
|
with:
|
|
go-version-file: go_backend/go.mod
|
|
cache-dependency-path: go_backend/go.sum
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
|
|
with:
|
|
channel: "stable"
|
|
flutter-version-file: .fvmrc
|
|
cache: true
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5
|
|
with:
|
|
gradle-version: "9.7.1"
|
|
|
|
- name: Install Android SDK & NDK
|
|
run: |
|
|
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true
|
|
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \
|
|
"ndk;29.0.14206865" \
|
|
"platforms;android-37.0" \
|
|
"build-tools;37.0.0"
|
|
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/29.0.14206865" >> "$GITHUB_ENV"
|
|
|
|
- name: Build Go backend for Android
|
|
working-directory: go_backend
|
|
run: |
|
|
go install golang.org/x/mobile/cmd/gomobile
|
|
gomobile init
|
|
mkdir -p ../android/app/libs
|
|
gomobile bind \
|
|
-target=android/arm,android/arm64 \
|
|
-androidapi 24 \
|
|
-o ../android/app/libs/gobackend.aar \
|
|
.
|
|
env:
|
|
CGO_ENABLED: 1
|
|
|
|
- name: Get Flutter dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Configure Flutter SDK for Gradle
|
|
run: echo "flutter.sdk=$FLUTTER_ROOT" > android/local.properties
|
|
|
|
- name: Compile Kotlin and run native unit tests
|
|
run: gradle -p android :app:compileDebugKotlin :app:testDebugUnitTest
|