Automated PR for Github Actions brick changes #5
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: Continuous Integration | |
permissions: | |
checks: write | |
pull-requests: write | |
on: | |
pull_request: | |
env: | |
FLUTTER_VERSION: "3.24.3" | |
jobs: | |
validate: | |
name: Validate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Format | |
run: dart format -o none --set-exit-if-changed lib/ test/ | |
- name: Analyze | |
run: flutter analyze --fatal-infos --fatal-warnings | |
build_ios: | |
name: Build iOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Clean | |
run: flutter clean | |
- name: Build | |
run: flutter build ios --no-codesign --release --flavor production -t lib/main_production.dart | |
build_android: | |
name: Build Android | |
runs-on: ubuntu-latest | |
env: | |
KEYSTORE_FILENAME: upload-keystore.jks | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Setup Keystore | |
run: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > ./android/app/${{ env.KEYSTORE_FILENAME }} | |
- name: Clean | |
run: flutter clean | |
- name: Build | |
run: flutter build appbundle --release --flavor production -t lib/main_production.dart | |
env: | |
ANDROID_KEYSTORE_PATH: ${{ env.KEYSTORE_FILENAME }} | |
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD }} | |
ANDROID_KEYSTORE_ALIAS: ${{ vars.ANDROID_KEYSTORE_ALIAS }} | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Install lcov | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install lcov | |
- name: Clean | |
run: flutter clean | |
- name: Run tests | |
run: flutter test --coverage --file-reporter json:test_results.json | |
- name: Remove generated files from coverage | |
run: lcov --remove coverage/lcov.info '**.g.dart' -o coverage/clean_lcov.info | |
- name: Publish test results | |
uses: dorny/[email protected] | |
if: success() || failure() | |
with: | |
name: Unit tests report | |
path: test_results.json | |
reporter: flutter-json | |
max-annotations: 50 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish coverage report | |
uses: zgosalvez/github-actions-report-lcov@v3 | |
with: | |
coverage-files: coverage/clean_lcov.info | |
minimum-coverage: 50 | |
artifact-name: code-coverage-report | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
update-comment: true | |
additional-message: Remember that you want to write high quality tests, so you can sleep well at night! |