Chore: Upgrade flutter packages #913
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow to check whether changes in a pull request fulfill all requirements. | |
# We execute build stages in separate jobs to prevent artifact duplication. | |
name: Status checks | |
on: | |
pull_request: | |
schedule: | |
# Run every sunday at noon. We run this on sunday such that we can utilize the free test minutes we get from Firebase. | |
# The weekly run ensures that cached resources don't expire. | |
- cron: "0 12 * * 0" | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# We make sure that lint succeeds before we start any other job to | |
# prevent that the setup-build-environment action runs in parallel. | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- run: bundle exec fastlane lint | |
unit-test: | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- run: bundle exec fastlane unit_test | |
build-irmagobridge-ios: | |
runs-on: macos-15 # MacOS version is pinned, because it determines which XCode version is used. | |
needs: lint | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- run: bundle exec fastlane ios_build_irmagobridge | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: irmagobridge-ios | |
path: ios/Runner/Irmagobridge.xcframework/ | |
build-irmagobridge-android: | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- run: bundle exec fastlane android_build_irmagobridge | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: irmagobridge-android | |
path: android/irmagobridge/irmagobridge.aar | |
build-prototypes-android: | |
runs-on: ubuntu-latest | |
needs: build-irmagobridge-android | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- name: Download irmagobridge artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: irmagobridge-android | |
path: android/irmagobridge/ | |
- run: flutter build apk --flavor alpha -t lib/main_prototypes.dart | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: prototypes-alpha-android | |
path: ./build/app/outputs/apk/alpha/release/*.apk | |
build-app-ios-alpha: | |
runs-on: macos-15 # MacOS version is pinned, because it determines which XCode version is used. | |
needs: build-irmagobridge-ios | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- name: Download irmagobridge artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: irmagobridge-ios | |
path: ios/Runner/Irmagobridge.xcframework/ | |
- name: Decode binary environment secrets | |
env: | |
APPLE_DEVELOPMENT_CERTIFICATE: ${{ secrets.APPLE_DEVELOPMENT_CERTIFICATE }} | |
APPLE_DEVELOPMENT_PROVISIONING_PROFILE: ${{ secrets.APPLE_DEVELOPMENT_PROVISIONING_PROFILE }} | |
run: | | |
mkdir -p ./fastlane/profiles | |
echo $APPLE_DEVELOPMENT_CERTIFICATE | base64 --decode > ./fastlane/profiles/ios_development.p12 | |
echo $APPLE_DEVELOPMENT_PROVISIONING_PROFILE | base64 --decode > ./fastlane/profiles/development.mobileprovision | |
- name: Build | |
run: > | |
bundle exec fastlane ios_build_app | |
flavor:alpha | |
certificate_path:profiles/ios_development.p12 | |
certificate_password:${{ secrets.APPLE_DEVELOPMENT_CERTIFICATE_PASSWORD }} | |
provisioning_profile_path:profiles/development.mobileprovision | |
code_signing_identity:"iPhone Developer" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: app-alpha-ios | |
path: ./fastlane/build/*.ipa | |
build-app-android: | |
runs-on: ubuntu-latest | |
needs: build-irmagobridge-android | |
strategy: | |
matrix: | |
flavor: [alpha, beta] | |
type: [apk, appbundle] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- name: Download irmagobridge artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: irmagobridge-android | |
path: android/irmagobridge/ | |
- name: Decode binary environment secrets | |
env: | |
ANDROID_DEVELOPMENT_SIGNING_KEYSTORE: ${{ secrets.ANDROID_DEVELOPMENT_SIGNING_KEYSTORE }} | |
run: | | |
mkdir -p ./fastlane/profiles | |
echo $ANDROID_DEVELOPMENT_SIGNING_KEYSTORE | base64 --decode > ./fastlane/profiles/keystore.jks | |
- name: Build | |
run: > | |
bundle exec fastlane android_build_${{ matrix.type }} | |
flavor:${{ matrix.flavor }} | |
keystore_path:profiles/keystore.jks | |
key_alias:android-signing-development | |
keystore_password:${{ secrets.ANDROID_DEVELOPMENT_SIGNING_KEYSTORE_PASSWORD }} | |
key_password:${{ secrets.ANDROID_DEVELOPMENT_SIGNING_KEYSTORE_PASSWORD }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: app-${{ matrix.flavor }}-android-${{ matrix.type }} | |
path: ./fastlane/build/* | |
build-integration-test-ios: | |
runs-on: macos-15 # MacOS version is pinned, because it determines which XCode version is used. | |
needs: build-irmagobridge-ios | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- name: Download irmagobridge artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: irmagobridge-ios | |
path: ios/Runner/Irmagobridge.xcframework/ | |
- name: Decode binary environment secrets | |
env: | |
APPLE_DEVELOPMENT_CERTIFICATE: ${{ secrets.APPLE_DEVELOPMENT_CERTIFICATE }} | |
APPLE_DEVELOPMENT_PROVISIONING_PROFILE: ${{ secrets.APPLE_DEVELOPMENT_PROVISIONING_PROFILE }} | |
run: | | |
mkdir -p ./fastlane/profiles | |
echo $APPLE_DEVELOPMENT_CERTIFICATE | base64 --decode > ./fastlane/profiles/ios_development.p12 | |
echo $APPLE_DEVELOPMENT_PROVISIONING_PROFILE | base64 --decode > ./fastlane/profiles/development.mobileprovision | |
- name: Build | |
run: > | |
bundle exec fastlane ios_build_integration_test | |
certificate_path:profiles/ios_development.p12 | |
certificate_password:${{ secrets.APPLE_DEVELOPMENT_CERTIFICATE_PASSWORD }} | |
provisioning_profile_path:profiles/development.mobileprovision | |
code_signing_identity:"iPhone Developer" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: integration-test-ios | |
path: ./fastlane/build/*.zip | |
- name: Dynamically generate matrix for running integration tests | |
id: set-matrix | |
# This oneliner gets every test zip generated by Fastlane and writes this as output to GitHub. This is used for the matrix in the integration-test-ios job below. | |
run: echo "matrix=$(for file in $(ls ./fastlane/build/*.zip); do basename "$file"; done | jq -R . | jq -sc .)" >> $GITHUB_OUTPUT | |
build-integration-test-android: | |
runs-on: ubuntu-latest | |
needs: build-irmagobridge-android | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup build environment | |
uses: ./.github/actions/setup-build-environment | |
- name: Download irmagobridge artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: irmagobridge-android | |
path: android/irmagobridge/ | |
- run: bundle exec fastlane android_build_integration_test | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: integration-test-android | |
path: ./fastlane/build/*.apk | |
integration-test-ios: | |
runs-on: ubuntu-latest | |
container: google/cloud-sdk:latest | |
needs: | |
- build-integration-test-ios | |
- unit-test # To prevent that test resources are used when we already know there is an issue. | |
strategy: | |
matrix: | |
file_name: ${{ fromJson(needs.build-integration-test-ios.outputs.matrix) }} | |
fail-fast: false # To prevent we have to re-run all tests when one run is flaky. | |
concurrency: integration-test-ios-${{ matrix.file_name }} # To prevent that we use too much test resources at the same time. | |
steps: | |
- name: Download test artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: integration-test-ios | |
path: . | |
- name: Authenticate to Firebase | |
env: | |
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }} | |
run: gcloud auth activate-service-account --key-file <(echo $GCLOUD_SERVICE_KEY) | |
shell: bash | |
- name: Set Firebase project | |
run: gcloud config set project ${{ secrets.GCLOUD_PROJECT_NAME }} | |
- name: Run integration tests for each zip file | |
run: | | |
gcloud firebase test ios run \ | |
--test ${{ matrix.file_name }} \ | |
--timeout 7m \ | |
--device=model=iphone8,orientation=portrait \ | |
--device=model=iphone8,orientation=landscape | |
# this summary is needed to report a final result for the ios test matrix | |
# this job is added to the branch protection rules, so the matrix has to fully pass before merge | |
integration-test-ios-summary: | |
runs-on: ubuntu-latest | |
needs: integration-test-ios # Wait for all matrix jobs | |
if: ${{ always() }} # Run even if a matrix job fails | |
steps: | |
- name: Check integration test results | |
run: | | |
if [ "${{ needs.integration-test-ios.result }}" == "failure" ] || [ "${{ needs.integration-test-ios.result }}" == "cancelled" ]; then | |
echo "One or more integration tests failed." | |
exit 1 | |
else | |
echo "All integration tests passed." | |
fi | |
integration-test-android: | |
runs-on: ubuntu-latest | |
container: google/cloud-sdk:latest | |
needs: | |
- build-integration-test-android | |
- unit-test # To prevent that test resources are used when we already know there is an issue. | |
concurrency: integration-test-android # To prevent that we use too much test resources at the same time. | |
steps: | |
- name: Download test artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: integration-test-android | |
path: . | |
- name: Authenticate to Firebase | |
env: | |
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }} | |
run: gcloud auth activate-service-account --key-file <(echo $GCLOUD_SERVICE_KEY) | |
shell: bash | |
- name: Set Firebase project | |
run: gcloud config set project ${{ secrets.GCLOUD_PROJECT_NAME }} | |
- name: Run integration tests | |
run: gcloud firebase test android run --use-orchestrator --app app-alpha-debug.apk --test app-alpha-debug-androidTest.apk --timeout 20m --device=model=Pixel2,version=28,orientation=portrait --device=model=Pixel2,version=28,orientation=landscape |