Skip to content

Remove firebase_options.dart generation from CI/CD pipeline and updat… #6

Remove firebase_options.dart generation from CI/CD pipeline and updat…

Remove firebase_options.dart generation from CI/CD pipeline and updat… #6

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [master, main]
paths:
- 'client/**'
- '.github/workflows/**'
pull_request:
branches: [master, main]
paths:
- 'client/**'
- '.github/workflows/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FLUTTER_VERSION: '3.38.5'
jobs:
quality:
name: Code quality checks
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Install dependencies
run: flutter pub get
- name: Check formatting
run: dart format --set-exit-if-changed .
- name: Analyze code
run: dart analyze
- name: Run tests
run: flutter test
build-android:
name: Build Android
runs-on: ubuntu-latest
needs: quality
defaults:
run:
working-directory: client
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Create google-services.json
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > android/app/google-services.json
- name: Install dependencies
run: flutter pub get
- name: Build APK
run: flutter build apk --debug
- name: Upload Android APK
uses: actions/upload-artifact@v4
with:
name: android-apk
path: client/build/app/outputs/flutter-apk/app-debug.apk
retention-days: 14
build-web:
name: Build Web
runs-on: ubuntu-latest
needs: quality
defaults:
run:
working-directory: client
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build web
run: flutter build web --release
- name: Upload web build
uses: actions/upload-artifact@v4
with:
name: web-build
path: client/build/web/
retention-days: 14
build-linux:
name: Build Linux
runs-on: ubuntu-latest
needs: quality
defaults:
run:
working-directory: client
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build Linux
run: flutter build linux --release
- name: Upload Linux build
uses: actions/upload-artifact@v4
with:
name: linux-build
path: client/build/linux/x64/release/bundle/
retention-days: 14
build-windows:
name: Build Windows
runs-on: windows-latest
needs: quality
defaults:
run:
working-directory: client
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build Windows
run: flutter build windows --release
- name: Upload Windows build
uses: actions/upload-artifact@v4
with:
name: windows-build
path: client/build/windows/x64/runner/Release/
retention-days: 14