ci: add Gitea Actions pipeline for test + Android APK + Linux build
This commit is contained in:
70
.github/workflows/ci.yml
vendored
Normal file
70
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
name: Build & Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: '3.35.7'
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
- name: Analyze
|
||||
run: flutter analyze
|
||||
- name: Run tests
|
||||
run: flutter test
|
||||
|
||||
build-android:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: '3.35.7'
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
- name: Build APK
|
||||
run: flutter build apk --release --split-per-abi --no-tree-shake-icons
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: habo-apks
|
||||
path: build/app/outputs/flutter-apk/
|
||||
|
||||
build-linux:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: '3.35.7'
|
||||
- name: Install Linux deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ninja-build clang cmake pkg-config libgtk-3-dev libblkid-dev liblzma-dev libasound2-dev
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
- name: Build
|
||||
run: flutter build linux --release
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: habo-linux
|
||||
path: build/linux/x64/release/bundle/
|
||||
Reference in New Issue
Block a user