Last active
October 22, 2024 00:34
-
-
Save nestorsgarzonc/5dc287b2108e6a522b07e4aeba8dafab to your computer and use it in GitHub Desktop.
CI.yml
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: Flutter CI | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| # Your desired branches | |
| - "main" | |
| jobs: | |
| flutter_unit_test: | |
| name: Run Flutter Tests and Analyze | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout the branch | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter SDK | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| cache: true | |
| - name: Cache Pub Dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.pub-cache | |
| key: ${{ runner.os }}-pub-${{ hashFiles('pubspec.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pub- | |
| - name: Get packages | |
| run: flutter pub get | |
| - name: Analyze code | |
| # If can specify the folder to analyze | |
| # flutter analyze lib --no-pub --fatal-warnings | |
| run: flutter analyze --no-pub --fatal-warnings | |
| - name: Run unit tests | |
| run: flutter test | |
| - name: Check code formatting | |
| run: dart format ./lib --set-exit-if-changed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment