Skip to content

Group Archiving

Group Archiving #417

Workflow file for this run

name: Test and build
on:
pull_request:
branches: [main]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_VERSION: 18
jobs:
test_flutter:
name: Run Flutter tests
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 15
cache: 'gradle'
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
- name: Copy .env
env:
DOT_ENV: ${{ secrets.DOT_ENV }}
run: echo $DOT_ENV > .env
- name: Get dependencies
run: flutter pub get
- name: Install derry
run: flutter pub global activate derry
- name: Generate mocks
run: derry create-mocks
- name: Run tests
run: flutter test
run_integration_tests:
name: Run Integration tests
runs-on: ubuntu-latest
env:
CHROME_VERSION: 114.0.5735.90
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 15
cache: 'gradle'
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
- name: Setup Dart
uses: dart-lang/setup-dart@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Copy .env
env:
DOT_ENV: ${{ secrets.DOT_ENV }}
run: echo $DOT_ENV > .env
- name: Install function dependencies
working-directory: functions
run: npm i
- name: Get dependencies
run: flutter pub get
- name: Configure Flutter for Web
run: flutter config --enable-web
- name: Get the web installers repo
run: git clone https://github.com/flutter/web_installers.git
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Start emulators
run: firebase emulators:start --only functions,firestore,auth --import ./emulator_data_testing & sleep 10
- name: Install Chrome Driver
uses: nanasess/setup-chromedriver@v2
- name: Start Chrome Driver
run: chromedriver --port=4444 & sleep 20
- name: Run integration tests
run: |
chmod +x ./scripts/run_integration_tests.sh
./scripts/run_integration_tests.sh
build_and_test_functions:
name: Run tests and build Firebase Functions
runs-on: ubuntu-latest
defaults:
run:
working-directory: functions
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm i
- name: Run linter
run: npm run lint
- name: Build functions
run: npm run build
- name: Start emulators
run: firebase emulators:start --only functions,firestore,auth & sleep 20
- name: Run functions tests
run: npm test
build_android:
name: Build Android App
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 15
cache: 'gradle'
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
- name: Copy .env
env:
DOT_ENV: ${{ secrets.DOT_ENV }}
run: echo $DOT_ENV > .env
- name: Get dependencies
run: flutter pub get
- name: Copy google-services.json
env:
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
run: echo $FIREBASE_CONFIG > android/app/google-services.json
- name: Configure Keystore
run: |
echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks
echo "storeFile=upload-keystore.jks" >> key.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties
env:
PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
working-directory: android
- name: Build App bundle
run: flutter build appbundle
build_web:
name: Build Web App
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 15
cache: 'gradle'
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
- name: Copy .env
env:
DOT_ENV: ${{ secrets.DOT_ENV }}
run: echo $DOT_ENV > .env
- name: Copy google-services.json
env:
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
run: echo $FIREBASE_CONFIG > android/app/google-services.json
- name: Get dependencies
run: flutter pub get
- name: Build Web app
run: flutter build web