Skip to content

Commit 310fae3

Browse files
committed
.e add caching for pub dependencies in CI and analysis workflows
1 parent 9bfa997 commit 310fae3

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/analysis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ jobs:
2323
with:
2424
sdk: ${{ matrix.sdk }}
2525

26+
- name: Cache pub dependencies
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.pub-cache
30+
key: ${{ runner.os }}-pub-${{ matrix.sdk }}-${{ hashFiles('**/pubspec.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-pub-${{ matrix.sdk }}-
33+
${{ runner.os }}-pub-
34+
2635
- name: Get dependencies
2736
run: dart pub get
2837

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ jobs:
1818
with:
1919
sdk: stable
2020

21+
- name: Cache pub dependencies
22+
uses: actions/cache@v4
23+
with:
24+
path: ~/.pub-cache
25+
key: ${{ runner.os }}-pub-stable-${{ hashFiles('**/pubspec.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-pub-stable-
28+
${{ runner.os }}-pub-
29+
2130
- name: Install dependencies
2231
run: dart pub get
2332

.github/workflows/format-check.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,17 @@ jobs:
1616
with:
1717
sdk: stable
1818

19+
- name: Cache pub dependencies
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.pub-cache
23+
key: ${{ runner.os }}-pub-stable-${{ hashFiles('**/pubspec.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-pub-stable-
26+
${{ runner.os }}-pub-
27+
28+
- name: Get dependencies
29+
run: dart pub get
30+
1931
- name: Check dart format
2032
run: dart format --output=none --set-exit-if-changed .

0 commit comments

Comments
 (0)