Last active
November 19, 2024 19:26
-
-
Save quentin7b/b88d10848eb91210d5396b2dd6187979 to your computer and use it in GitHub Desktop.
CD for flutter projects
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: cd | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
title: | |
name: Validate PR title | |
runs-on: ubuntu-latest | |
steps: | |
- uses: amannn/action-semantic-pull-request@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
linter: | |
name: Flutter lints | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: subosito/[email protected] | |
with: | |
flutter-version: '${{ env.FLUTTER_VERSION }}' | |
channel: '${{ env.FLUTTER_CHANNEL }}' | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.pub-cache | |
.dart_tool | |
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pub- | |
- name: Lint project | |
run: | | |
flutter pub get | |
flutter analyze . | |
tests: | |
name: Flutter test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: subosito/[email protected] | |
with: | |
flutter-version: '${{ env.FLUTTER_VERSION }}' | |
channel: '${{ env.FLUTTER_CHANNEL }}' | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.pub-cache | |
.dart_tool | |
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pub- | |
- name: Test project | |
run: | | |
flutter pub get | |
flutter test | |
env: | |
FLUTTER_VERSION: '3.24.3' | |
FLUTTER_CHANNEL: 'stable' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment