fix: get initial app link error #609
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: build test (android, iOS) | |
on: | |
pull_request: | |
branches: | |
- main | |
- development | |
- development-v4 | |
jobs: | |
check-test-required: | |
name: Check if test is required | |
runs-on: ubuntu-latest | |
outputs: | |
android-changed: ${{ steps.android-changed-files.outputs.any_changed }} | |
ios-changed: ${{ steps.ios-changed-files.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Changed Files (android) | |
uses: tj-actions/[email protected] | |
id: android-changed-files | |
with: | |
files: | | |
pubspec.yaml | |
pubspec.lock | |
android/** | |
lib/** | |
- name: Changed Files (iOS) | |
uses: tj-actions/[email protected] | |
id: ios-changed-files | |
with: | |
files: | | |
pubspec.yaml | |
pubspec.lock | |
ios/** | |
lib/** | |
build-and-test: | |
name: Build ${{ matrix.os }} App and Test | |
needs: check-test-required | |
strategy: | |
fail-fast: false | |
matrix: | |
build-os: [ubuntu-latest, macos-15] | |
include: | |
- build-os: ubuntu-latest | |
os: Android | |
- build-os: macos-15 | |
os: iOS | |
runs-on: ${{ matrix.build-os }} | |
concurrency: | |
group: ${{ matrix.os }}-test-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
steps: | |
- name: setup env | |
run: | | |
echo "run=${{ | |
matrix.os == 'Android' && needs.check-test-required.outputs.android-changed == 'true' || | |
matrix.os == 'iOS' && needs.check-test-required.outputs.ios-changed == 'true' | |
}}" >> $GITHUB_ENV | |
echo "directory=$(echo ${{ matrix.os }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
if: env.run == 'true' | |
- uses: subosito/flutter-action@v2 | |
if: env.run == 'true' | |
with: | |
flutter-version: "3.27.1" | |
channel: "stable" | |
cache: true | |
- uses: actions/cache@v4 | |
if: env.run == 'true' | |
with: | |
path: | | |
.dart_tool | |
!.dart_tool/**/*.snapshot | |
key: ${{ runner.os }}-dart-tool-${{ hashFiles('pubspec.lock') }} | |
- name: install flutterfire | |
if: env.run == 'true' | |
run: flutter pub global activate flutterfire_cli | |
- uses: actions/cache@v4 | |
if: env.run == 'true' && matrix.os == 'iOS' | |
with: | |
path: | | |
~/.cocoapods | |
~/Library/Caches/CocoaPods | |
key: cocoapods-${{ hashFiles('ios/Podfile.lock') }} | |
- uses: actions/setup-java@v4 | |
if: env.run == 'true' && matrix.os == 'Android' | |
with: | |
java-version: "17" | |
distribution: "adopt" | |
- uses: ruby/setup-ruby@v1 | |
if: env.run == 'true' | |
with: | |
ruby-version: "3.2.0" | |
bundler-cache: true | |
working-directory: ${{ env.directory }} | |
- name: Copy dotenv | |
if: env.run == 'true' | |
run: | | |
echo '${{ vars.DOTENV }}' > .env | |
echo "AMPLITUDE_API_KEY=${{ secrets.AMPLITUDE_API_KEY }}" >> .env | |
echo "SMARTLOOK_API_KEY=${{ secrets.SMARTLOOK_API_KEY }}" >> .env | |
- name: Generate files | |
if: env.run == 'true' | |
run: | | |
dart run slang | |
dart run build_runner build --delete-conflicting-outputs | |
- name: Run fastlane | |
if: env.run == 'true' | |
run: bundle exec fastlane test | |
working-directory: ${{ env.directory }} |