add cache pub-cache #6
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: Flutter CI | |
on: | |
push: | |
branches: | |
- aes-algorithm # Adjust this to your default branch if necessary | |
pull_request: | |
branches: | |
- aes-algorithm | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v2 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.19.6' # Specify the Flutter version, e.g., '2.10.0' | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pub-cache | |
key: ${{ runner.os }}-pub-cache-${{ hashFiles('pubspec.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pub-cache- | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Run tests & generate coverage | |
run: flutter test --coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
files: ./coverage/lcov.info | |
flags: flutter | |
name: code-coverage-report | |
token: 2f59bcbb-7263-4e0c-9a37-e710e39705bb # Add this to your GitHub secrets | |
fail_ci_if_error: true |