Skip to content

Commit

Permalink
test: update caching strategies for github actions (#13312)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley authored Sep 11, 2024
1 parent cb481e0 commit b8f3869
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ jobs:
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
key: firebase-emulators-v3-${{ runner.os }}
restore-keys: firebase-emulators-v3
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
channel: 'stable'
cache: true
cache-key: flutter-${{ runner.os }}
pub-cache-key: pub-${{ runner.os }}
- uses: bluefireteam/melos-action@7e70fbe34bbd91a75eb505eeb4174b0ac9a1df52
with:
run-bootstrap: false
Expand All @@ -76,7 +78,7 @@ jobs:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-ubuntu
key: avd-${{ runner.os }}
- name: Start AVD then run E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,27 @@ jobs:
- uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-ios-v3
key: xcode-cache-${{ runner.os }}
max-size: 700M
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
name: Pods Cache
id: pods-cache
with:
path: tests/ios/Pods
key: ${{ runner.os }}-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-ios-pods-v2
key: pods-v3-${{ runner.os }}-${{ hashFiles('tests/ios/Podfile.lock') }}
restore-keys: pods-v3-${{ runner.os }}
- name: Firebase Emulator Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
key: firebase-emulators-v3-${{ runner.os }}
restore-keys: firebase-emulators-v3
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
channel: 'stable'
cache: true
cache-key: flutter-${{ runner.os }}
pub-cache-key: pub-${{ runner.os }}
- uses: bluefireteam/melos-action@7e70fbe34bbd91a75eb505eeb4174b0ac9a1df52
with:
run-bootstrap: false
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,27 @@ jobs:
- uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-macos-v2
key: xcode-cache-${{ runner.os }}
max-size: 700M
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
name: Pods Cache
id: pods-cache
with:
path: tests/macos/Pods
key: ${{ runner.os }}-pods-v2-${{ hashFiles('tests/macos/Podfile.lock') }}
restore-keys: ${{ runner.os }}-macos-pods-v1
key: pods-v3-${{ runner.os }}-${{ hashFiles('tests/macos/Podfile.lock') }}
restore-keys: pods-v3-${{ runner.os }}
- name: Cache Firebase Emulator
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
key: firebase-emulators-v3-${{ runner.os }}
restore-keys: firebase-emulators-v3
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
channel: 'stable'
cache: true
cache-key: flutter-${{ runner.os }}
pub-cache-key: pub-${{ runner.os }}
- uses: bluefireteam/melos-action@7e70fbe34bbd91a75eb505eeb4174b0ac9a1df52
with:
run-bootstrap: false
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: flutter-${{ runner.os }}
pub-cache-key: pub-${{ runner.os }}
- uses: bluefireteam/melos-action@7e70fbe34bbd91a75eb505eeb4174b0ac9a1df52
with:
run-bootstrap: false
Expand All @@ -57,7 +59,7 @@ jobs:
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
key: firebase-emulators-v3-${{ runner.os }}
restore-keys: firebase-emulators-v3
- name: Start Firebase Emulator
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
Expand Down Expand Up @@ -95,6 +97,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: flutter-${{ runner.os }}
pub-cache-key: pub-${{ runner.os }}
- uses: bluefireteam/melos-action@7e70fbe34bbd91a75eb505eeb4174b0ac9a1df52
with:
run-bootstrap: false
Expand All @@ -107,7 +111,7 @@ jobs:
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
key: firebase-emulators-v3-${{ runner.os }}
restore-keys: firebase-emulators-v3
- name: Start Firebase Emulator
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
Expand Down Expand Up @@ -150,6 +154,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: flutter-${{ runner.os }}
pub-cache-key: pub-${{ runner.os }}
- uses: bluefireteam/melos-action@7e70fbe34bbd91a75eb505eeb4174b0ac9a1df52
with:
run-bootstrap: false
Expand All @@ -162,7 +168,7 @@ jobs:
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
key: firebase-emulators-v3-${{ runner.os }}
restore-keys: firebase-emulators-v3
- name: Start Firebase Emulator
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: flutter-${{ runner.os }}
pub-cache-key: pub-${{ runner.os }}
- uses: bluefireteam/melos-action@7e70fbe34bbd91a75eb505eeb4174b0ac9a1df52
with:
run-bootstrap: false
Expand Down Expand Up @@ -70,6 +72,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: flutter-${{ runner.os }}
pub-cache-key: pub-${{ runner.os }}
- uses: bluefireteam/melos-action@7e70fbe34bbd91a75eb505eeb4174b0ac9a1df52
with:
run-bootstrap: false
Expand Down

0 comments on commit b8f3869

Please sign in to comment.