Skip to content

Commit

Permalink
Optimize workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
quoc-huynh-cosee committed Nov 26, 2024
1 parent 523e0a7 commit 919711f
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache asdf
uses: actions/cache@v4
id: asdf_cache
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}
- uses: asdf-vm/actions/install@v3
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
restore-keys: ${{ runner.os }}-asdf-
- name: Install asdf
uses: asdf-vm/actions/install@v3
# See https://github.com/asdf-vm/actions/issues/445
if: steps.cache-asdf.outputs.cache-hit != 'true'

- name: Cache flutter dependencies
uses: actions/cache@v4
id: flutter_cache
with:
path: .dart_tool/
key: ${{ runner.os }}-${{ hashFiles('**/pubspec.lock') }}
path: |
.dart_tool/
~/.pub-cache/
key: ${{ runner.os }}-flutter-${{ hashFiles('example/pubspec.lock') }}
restore-keys: ${{ runner.os }}-flutter-
- name: Install dependencies
run: flutter pub get

Expand All @@ -35,26 +41,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache asdf
uses: actions/cache@v4
id: asdf_cache
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}
- uses: asdf-vm/actions/install@v3
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
restore-keys: ${{ runner.os }}-asdf-
- name: Install asdf
uses: asdf-vm/actions/install@v3
# See https://github.com/asdf-vm/actions/issues/445
if: steps.cache-asdf.outputs.cache-hit != 'true'

- name: Install WebP
run: |
sudo apt update
sudo apt install webp
- name: Cache flutter dependencies
uses: actions/cache@v4
id: flutter_cache
with:
path: |
.dart_tool/
~/.pub-cache/
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/pubspec.lock') }}
key: ${{ runner.os }}-flutter-${{ hashFiles('example/pubspec.lock') }}
restore-keys: ${{ runner.os }}-flutter-
- name: Install Dependencies
run: |
flutter pub get
Expand Down

0 comments on commit 919711f

Please sign in to comment.