Create README.md #43
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: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the latest version of the code | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| # Cache Flutter SDK | |
| - name: Cache Flutter SDK | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.pub-cache | |
| key: flutter-${{ runner.os }}-${{ hashFiles('pubspec.yaml') }} | |
| restore-keys: | | |
| flutter-${{ runner.os }}- | |
| # Install Flutter SDK | |
| - name: Install Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.10.5' # Specify the Flutter version you are using | |
| # Change to the project directory if it's not at the root | |
| - name: Change to project directory | |
| run: cd your_project_directory # Replace 'your_project_directory' with the actual path | |
| # Run Flutter Pub Get to restore dependencies | |
| - name: Install dependencies | |
| run: flutter pub get | |
| # Cache build artifacts | |
| - name: Cache build | |
| uses: actions/cache@v3 | |
| with: | |
| path: build | |
| key: build-${{ runner.os }}-${{ hashFiles('pubspec.yaml') }} | |
| restore-keys: | | |
| build-${{ runner.os }}- | |
| # Run tests | |
| - name: Run tests | |
| run: flutter test |