From faff8977d46be3f674a24198074d0f1c9f005da0 Mon Sep 17 00:00:00 2001 From: Quoc Huynh Date: Thu, 2 Nov 2023 16:56:37 +0100 Subject: [PATCH] Optimize workflow Signed-off-by: Quoc Huynh --- .github/workflows/main.yaml | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7fd9818..a33c979 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -3,29 +3,28 @@ name: interactive_bottom_sheet on: [ push ] jobs: - lint: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2.11.0 - - name: Install Dependencies + - name: Cache dependencies + uses: actions/cache@v3 + id: cache + with: + path: | + .dart_tool/ + key: ${{ runner.os }}-dependencies-${{ hashFiles('**/pubspec.lock') }} + - name: Install dependencies run: flutter pub get - - name: Analyze - run: flutter analyze - - name: Code metrics - run: dart run dart_code_metrics:metrics analyze . --set-exit-on-violation-level=warning --disable-sunset-warning - style_check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2.11.0 - - - name: Install Dependencies - run: flutter pub get - - name: Format + - name: Format code run: dart format --set-exit-if-changed . + - name: Analyze code + run: flutter analyze + - name: Run Code metrics + run: dart run dart_code_metrics:metrics analyze . --set-exit-on-violation-level=warning --disable-sunset-warning pana: runs-on: ubuntu-latest @@ -37,9 +36,17 @@ jobs: run: | sudo apt update sudo apt install webp + - name: Cache dependencies + uses: actions/cache@v3 + id: cache + with: + path: | + .dart_tool/ + key: ${{ runner.os }}-dependencies-${{ hashFiles('**/pubspec.lock') }} - name: Install Dependencies run: | flutter pub get flutter pub global activate pana + - name: Verify Pub Score run: ./tool/verify_pub_score.sh