- Add Cache Dependencies workflow on main branch to be available for all sub branches - Replace static cache key with hash of dependencies pubspec.yaml
- Add Cache Dependencies workflow on main branch to be available for all sub branches - Replace static cache key with hash of dependencies pubspec.yaml
OmarHatem committed
Dec 22, 2022 at 20:59 UTC
40270e84c9c6c09ff5710a69a80e17c9f536fbec
2 files changed
+57
-1
.github/workflows/cache_dependencies.yml
new
+56
@@ -0,0 +1,56 @@
1
+name: Cache Dependencies
2
+
3
+on:
4
+ push:
5
+ branches: [ main ]
6
+
7
+jobs:
8
+ test:
9
+
10
+ runs-on: ubuntu-18.04
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: actions/setup-java@v1
15
+ with:
16
+ java-version: '8.x'
17
+
18
+ - name: Flutter action
19
+ uses: subosito/flutter-action@v1
20
+ with:
21
+ flutter-version: '3.3.x'
22
+ channel: stable
23
+
24
+ - name: Install package dependencies
25
+ run: sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang
26
+
27
+ - name: Execute Build and Setup Commands
28
+ run: |
29
+ sudo mkdir -p /opt/android
30
+ sudo chown $USER /opt/android
31
+ cd /opt/android
32
+ git clone https://github.com/cake-tech/cake_wallet.git --branch main
33
+ cd cake_wallet/scripts/android/
34
+ ./install_ndk.sh
35
+ source ./app_env.sh cakewallet
36
+ ./app_config.sh
37
+
38
+ - name: Cache Externals
39
+ id: cache-externals
40
+ uses: actions/cache@v3
41
+ with:
42
+ path: |
43
+ /opt/android/cake_wallet/cw_haven/android/.cxx
44
+ /opt/android/cake_wallet/cw_haven/ios/External
45
+ /opt/android/cake_wallet/cw_monero/android/.cxx
46
+ /opt/android/cake_wallet/cw_monero/ios/External
47
+ /opt/android/cake_wallet/cw_shared_external/ios/External
48
+ key: ${{ hashFiles('/opt/android/cake_wallet/cw_haven/pubspec.yaml', '/opt/android/cake_wallet/cw_monero/pubspec.yaml', '/opt/android/cake_wallet/cw_shared_external/pubspec.yaml') }}
49
+
50
+ - if: ${{ steps.cache-externals.outputs.cache-hit != 'true' }}
51
+ name: Generate Externals
52
+ run: |
53
+ cd /opt/android/cake_wallet/scripts/android/
54
+ source ./app_env.sh cakewallet
55
+ ./build_all.sh
56
+ ./copy_monero_deps.sh
.github/workflows/pr_test_build.yml
+1
-1
@@ -45,7 +45,7 @@ jobs:
45
/opt/android/cake_wallet/cw_monero/android/.cxx
46
/opt/android/cake_wallet/cw_monero/ios/External
47
/opt/android/cake_wallet/cw_shared_external/ios/External
48
- key: externals-cache-key
48
+ key: ${{ hashFiles('/opt/android/cake_wallet/cw_haven/pubspec.yaml', '/opt/android/cake_wallet/cw_monero/pubspec.yaml', '/opt/android/cake_wallet/cw_shared_external/pubspec.yaml') }}
49
50
- if: ${{ steps.cache-externals.outputs.cache-hit != 'true' }}
51
name: Generate Externals