Flutter #49
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Flutter | |
on: | |
push: | |
branches: [ develop ] | |
tags-ignore: | |
- 'v*' | |
pull_request: | |
branches: [ develop ] | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Java version | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '12.x' | |
- name: Flutter version | |
uses: subosito/[email protected] | |
with: | |
channel: 'stable' | |
- name: Flutter Stable | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 2 | |
command: flutter channel stable | |
- name: Flutter Upgrade | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 2 | |
command: flutter upgrade | |
- name: Setup OnePub | |
env: | |
ONEPUB_TOKEN: ${{ secrets.ONEPUB_TOKEN }} | |
run: | | |
echo "Setting up OnePub..." | |
mkdir -p $PUB_CACHE/credentials | |
dart pub global activate onepub | |
dart pub global run onepub import | |
echo "Verifying OnePub setup..." | |
ls -la $PUB_CACHE/credentials/ || echo "Failed to list credentials directory" | |
cat $PUB_CACHE/credentials/credentials.json || echo "Failed to read credentials file" | |
# Add pub credentials directly | |
echo '{ | |
"https://onepub.dev/api/kdpxxpsdav/": { | |
"token": "${{ secrets.ONEPUB_TOKEN }}" | |
} | |
}' > $PUB_CACHE/credentials/credentials.json | |
- name: Flutter Pub Get | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 2 | |
command: flutter pub get | |
- name: Check Flutter and Dart versions | |
run: | | |
flutter --version | |
DART_PATH=$(dirname $(which dart)) | |
echo "DART_PATH=$DART_PATH" >> $GITHUB_ENV | |
- name: Create a dummy .prod.env file | |
run: echo -e "var BASE_URL = ''; \nvar INIT_TOKEN = '';" > .prod.env | |
- name: Create a dummy .staging.env file | |
run: echo -e "var BASE_URL = ''; \nvar INIT_TOKEN = '';" > .staging.env | |
- name: Run Riverpod generator | |
run: flutter packages pub run build_runner build --delete-conflicting-outputs | |
- name: Run Pigeon generator | |
run: flutter pub run pigeon --input pigeon_conf.dart | |
- name: Run Unit Tests | |
run: flutter test --coverage | |
- name: Upload Test Coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
file: coverage/lcov.info | |
fail_ci_if_error: true | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: flutter-artifacts | |
path: build/ |