-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ jobs: | |
target: [x86_64-pc-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin] | ||
env: | ||
TARGET: ${{matrix.target}} | ||
SCCACHE_GHA_ENABLED: "true" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -47,15 +48,25 @@ jobs: | |
- name: Setup user dependencies | ||
run: ./make.sh ci-setup-user-deps | ||
|
||
- name: Restore cpp build cache | ||
id: cpp-cache-restore | ||
- name: Restore depends build cache | ||
id: depends-cache-restore | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
./build/depends | ||
./build/src | ||
~/.ccache | ||
key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} | ||
path: ./build/depends | ||
key: depends-${{ env.TARGET }}-${{ env.BUILD_TYPE }} | ||
|
||
# - name: Restore cpp build cache | ||
# id: cpp-cache-restore | ||
# uses: actions/cache/restore@v3 | ||
# with: | ||
# path: | | ||
# ./build/depends | ||
# ./build/src | ||
# ~/.ccache | ||
# key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Rust build cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
@@ -74,24 +85,41 @@ jobs: | |
name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} | ||
path: ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} | ||
|
||
- name: Delete previous cpp cache | ||
if: ${{ github.ref == 'refs/heads/master' && steps.cpp-cache-restore.outputs.cache-hit }} | ||
- name: Delete previous depends build cache | ||
if: ${{ steps.cpp-cache-restore.outputs.cache-hit }} | ||
# if: ${{ github.ref == 'refs/heads/master' && steps.cpp-cache-restore.outputs.cache-hit }} | ||
continue-on-error: true | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
gh actions-cache delete "cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }}" --confirm | ||
gh actions-cache delete "depends-${{ env.TARGET }}-${{ env.BUILD_TYPE }}" --confirm | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Save cpp cache | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
- name: Save depends build cache | ||
# if: ${{ github.ref == 'refs/heads/master' }} | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
./build/depends | ||
./build/src | ||
~/.ccache | ||
key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} | ||
path: ./build/depends | ||
key: depends-${{ env.TARGET }}-${{ env.BUILD_TYPE }} | ||
|
||
# - name: Delete previous cpp cache | ||
# if: ${{ github.ref == 'refs/heads/master' && steps.cpp-cache-restore.outputs.cache-hit }} | ||
# continue-on-error: true | ||
# run: | | ||
# gh extension install actions/gh-actions-cache | ||
# gh actions-cache delete "cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }}" --confirm | ||
# env: | ||
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# - name: Save cpp build cache | ||
# if: ${{ github.ref == 'refs/heads/master' }} | ||
# uses: actions/cache/save@v3 | ||
# with: | ||
# path: | | ||
# ./build/depends | ||
# ./build/src | ||
# ~/.ccache | ||
# key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} | ||
|
||
docker-build: | ||
runs-on: ubuntu-latest | ||
|