Refactor themes #232
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '**/README.md' | |
| pull_request: | |
| branches: [ main ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| test-app: | |
| name: App | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| - name: Flutter version | |
| run: flutter --version | |
| - name: Cache pub dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.HOME }}/.pub-cache | |
| key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} | |
| restore-keys: ${{ runner.os }}-pub- | |
| - name: Download pub dependencies | |
| run: flutter pub get | |
| - name: Run analyzer | |
| run: flutter analyze | |
| - name: Run tests | |
| run: flutter test --coverage | |
| - name: Install lcov | |
| run: sudo apt-get install -y lcov | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-test-results | |
| path: build/ | |
| - name: Clean coverage report | |
| run: | | |
| lcov --remove coverage/lcov.info \ | |
| 'lib/**.gen.dart' \ | |
| 'lib/generated/**' \ | |
| 'lib/di/**' \ | |
| 'lib/constants/**' \ | |
| 'lib/routers/router.dart' \ | |
| -o coverage/lcov.info \ | |
| --ignore-errors unused | |
| - name: Check Code Coverage | |
| uses: VeryGoodOpenSource/[email protected] | |
| with: | |
| path: coverage/lcov.info | |
| min_coverage: 59 | |
| exclude: | | |
| **/*.g.dart | |
| **/*.gen.dart | |
| lib/di/** | |
| lib/generated/** | |
| lib/constants/** | |
| lib/routers/router.dart | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| - name: Codacy Coverage Reporter | |
| uses: codacy/codacy-coverage-reporter-action@v1 | |
| with: | |
| project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
| coverage-reports: ./coverage/lcov.info | |
| integration-tests: | |
| name: Flutter Integration Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| api-level: [ 31 ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Setup Android emulator and run integration tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| arch: x86_64 | |
| target: google_apis | |
| profile: Nexus 6 | |
| script: | | |
| flutter pub get | |
| flutter test integration_test --flavor dev |