chore: update freezed #107
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
name: "Test" | |
on: | |
workflow_dispatch: | |
workflow_call: | |
secrets: | |
APP_STORE_CONNECT_APPLE_ID: | |
required: true | |
APP_STORE_CONNECT_ISSUER_ID: | |
required: true | |
APP_STORE_CONNECT_API_KEY_ID: | |
required: true | |
APP_STORE_CONNECT_API_KEY_FILE: | |
required: true | |
APP_STORE_DISTRIBUTION_CERT_ID: | |
required: true | |
APP_STORE_DISTRIBUTION_CERT_KEY_FILE: | |
required: true | |
CODECOV_TOKEN: | |
required: true | |
SECRET_SETTING_TOKEN: | |
required: true | |
outputs: | |
next_version: | |
description: "Version that could be used next without collision, determined while testing the fastlane setup." | |
value: ${{ jobs.test-fastlane.outputs.next_version }} | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-flutter: | |
name: "Flutter" | |
runs-on: macos-latest | |
timeout-minutes: 10 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- name: "Setup empty .env.local" | |
run: cp .env .env.local | |
- name: "Determine Flutter Version" | |
id: flutter-version | |
run: echo "FLUTTER_VERSION=$(jq -r ".flutterSdkVersion" .fvm/fvm_config.json)" >> $GITHUB_OUTPUT | |
- name: "Install Flutter" | |
uses: subosito/[email protected] | |
with: | |
flutter-version: ${{ steps.flutter-version.outputs.FLUTTER_VERSION }} | |
cache: true | |
- name: "Pub Get" | |
run: flutter pub get # so pub get doesn't clutter flutter test output | |
# TODO also run flutter analyze | |
# TODO also check if build_runner works | |
- name: "Run Tests" | |
id: run-tests | |
run: flutter test --coverage --suppress-analytics --machine | tee test-report.json # --suppress-analytics needed to have a valid json | |
- name: "Add test results to status check" | |
uses: phoenix-actions/test-reporting@v12 | |
if: always() && (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') | |
with: | |
reporter: dart-json | |
name: "Test Results: Flutter" | |
path: test-report.json | |
- name: "Upload Coverage Report to Codecov" | |
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage/lcov.info | |
fail_ci_if_error: true | |
test-fastlane: | |
name: "Fastlane" | |
runs-on: macos-latest | |
env: | |
APP_STORE_CONNECT_APPLE_ID: ${{ secrets.APP_STORE_CONNECT_APPLE_ID }} | |
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} | |
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} | |
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- name: "Setup Ruby" | |
uses: ruby/setup-ruby@52b8784594ec115fd17094752708121dc5dabb47 # v1.154.0 | |
with: | |
# using .ruby-version | |
# installing gems automatically | |
bundler-cache: true # requires BUNDLE_GEMFILE | |
- name: "Setup Xcode" | |
uses: maxim-lobanov/[email protected] | |
with: | |
xcode-version: latest-stable | |
- name: "Setup App Store Connect API key" | |
env: | |
# 1. `base64 -i AuthKey_<...>.p8 -o AuthKey_<...>.base64` | |
# 2. `pbcopy < AuthKey_<...>.base64` and paste without a newline | |
APP_STORE_CONNECT_API_KEY_FILE: ${{ secrets.APP_STORE_CONNECT_API_KEY_FILE }} | |
run: | | |
mkdir ~/.private_keys | |
echo $APP_STORE_CONNECT_API_KEY_FILE | base64 --decode > ~/.private_keys/AuthKey_${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}.p8 | |
- name: "Setup Google Play Console API key" | |
env: | |
# 1. `base64 -i play-store-credentials.json -o play-store-credentials.base64` | |
# 2. `pbcopy < play-store-credentials.base64` and paste without a newline | |
GOOGLE_PLAY_CONSOLE_API_KEY_FILE: ${{ secrets.GOOGLE_PLAY_CONSOLE_API_KEY_FILE }} | |
run: | | |
echo $GOOGLE_PLAY_CONSOLE_API_KEY_FILE | base64 --decode > ./android/play-store-credentials.json | |
- name: "Check App & Play Store access by calculating next version" | |
run: bundle exec fastlane set_next_version | |
- name: "Read next version from pubspec.yaml" | |
id: pubspec-version | |
run: echo "next_version=$(yq '.version' pubspec.yaml)" >> $GITHUB_OUTPUT | |
- name: "Setup iOS distribution certificate key" | |
env: | |
# automatically generated by previous runs via fastlane | |
APP_STORE_DISTRIBUTION_CERT_KEY_FILE: ${{ secrets.APP_STORE_DISTRIBUTION_CERT_KEY_FILE }} | |
run: | | |
echo $APP_STORE_DISTRIBUTION_CERT_KEY_FILE | base64 --decode > ${{ secrets.APP_STORE_DISTRIBUTION_CERT_ID }}.p12 | |
- name: "Check iOS certificates by ensuring validity" | |
env: | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
SECRET_SETTING_TOKEN: ${{ secrets.SECRET_SETTING_TOKEN }} | |
run: bundle exec fastlane ios_ensure_valid_distribution_certificate | |
outputs: | |
next_version: ${{ steps.pubspec-version.outputs.next_version }} |