File tree Expand file tree Collapse file tree 4 files changed +30
-4
lines changed Expand file tree Collapse file tree 4 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 1+ # This workflow relies on actions/cache to store the hak dependency artifacts as they take a long time to build
2+ # Due to this extra care must be taken to only ever run all build_* scripts against the same branch to ensure
3+ # the correct cache scoping, and additional care must be taken to not run untrusted actions on the develop branch.
14on :
25 workflow_call :
36 inputs :
@@ -16,19 +19,21 @@ jobs:
1619 name : webapp
1720
1821 - name : Cache .hak
22+ id : cache
1923 uses : actions/cache@v3
2024 with :
21- key : ${{ hashFiles('./yarn.lock ') }}
25+ key : ${{ runner.os }}-${{ hashFiles('hakDependencies.json', 'electronVersion ') }}
2226 path : |
2327 ./.hak
2428
2529 - name : Install Rust
30+ if : steps.cache.outputs.cache-hit != 'true'
2631 uses : actions-rs/toolchain@v1
2732 with :
2833 toolchain : stable
2934
3035 - name : Install libsqlcipher-dev
31- if : inputs.sqlcipher == 'system'
36+ if : steps.cache.outputs.cache-hit != 'true' && inputs.sqlcipher == 'system'
3237 run : sudo apt-get install -y libsqlcipher-dev
3338
3439 - uses : actions/setup-node@v3
4045 run : " yarn install --pure-lockfile"
4146
4247 - name : Build Natives
48+ if : steps.cache.outputs.cache-hit != 'true'
4349 run : " yarn build:native"
4450 env :
4551 SQLCIPHER_STATIC : ${{ inputs.sqlcipher == 'static' && '1' || '' }}
Original file line number Diff line number Diff line change 1+ # This workflow relies on actions/cache to store the hak dependency artifacts as they take a long time to build
2+ # Due to this extra care must be taken to only ever run all build_* scripts against the same branch to ensure
3+ # the correct cache scoping, and additional care must be taken to not run untrusted actions on the develop branch.
14on :
25 workflow_call :
36jobs :
@@ -11,13 +14,15 @@ jobs:
1114 name : webapp
1215
1316 - name : Cache .hak
17+ id : cache
1418 uses : actions/cache@v3
1519 with :
16- key : ${{ hashFiles('./yarn.lock ') }}
20+ key : ${{ runner.os }}-${{ hashFiles('hakDependencies.json', 'electronVersion ') }}
1721 path : |
1822 ./.hak
1923
2024 - name : Install Rust
25+ if : steps.cache.outputs.cache-hit != 'true'
2126 uses : actions-rs/toolchain@v1
2227 with :
2328 toolchain : stable
3237 run : " yarn install --pure-lockfile"
3338
3439 - name : Build Natives
40+ if : steps.cache.outputs.cache-hit != 'true'
3541 run : " yarn build:native:universal"
3642
3743 - name : Build App
Original file line number Diff line number Diff line change @@ -26,10 +26,18 @@ jobs:
2626 - name : Fetch Element Web
2727 run : yarn run fetch --noverify -d ${{ inputs.config }} ${{ inputs.version }}
2828
29+ # We split this out to save the build_* scripts having to do it to make use of `hashFiles` in the cache action
30+ - name : Generate cache hash files
31+ run : |
32+ yarn run --silent electron --version > electronVersion
33+ cat package.json | jq -c .hakDependencies > hakDependencies.json
34+
2935 - uses : actions/upload-artifact@v3
3036 with :
3137 name : webapp
3238 retention-days : 1
3339 path : |
3440 webapp.asar
3541 package.json
42+ electronVersion
43+ hakDependencies.json
Original file line number Diff line number Diff line change 1+ # This workflow relies on actions/cache to store the hak dependency artifacts as they take a long time to build
2+ # Due to this extra care must be taken to only ever run all build_* scripts against the same branch to ensure
3+ # the correct cache scoping, and additional care must be taken to not run untrusted actions on the develop branch.
14on :
25 workflow_call :
36 inputs :
3235 name : webapp
3336
3437 - name : Cache .hak
38+ id : cache
3539 uses : actions/cache@v3
3640 with :
37- key : ${{ runner.os }}-${{ hashFiles('./yarn.lock ') }}
41+ key : ${{ runner.os }}-${{ hashFiles('hakDependencies.json', 'electronVersion ') }}
3842 path : |
3943 ./.hak
4044
5862 echo "C:/Program Files/NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
5963
6064 - name : Install Rust
65+ if : steps.cache.outputs.cache-hit != 'true'
6166 uses : actions-rs/toolchain@v1
6267 with :
6368 toolchain : stable
7277 run : " yarn install --pure-lockfile"
7378
7479 - name : Build Natives
80+ if : steps.cache.outputs.cache-hit != 'true'
7581 run : |
7682 refreshenv
7783 yarn build:native --target ${{ steps.config.outputs.target }}
You can’t perform that action at this time.
0 commit comments