From e49782c5aa891285c8cb6ed8723c287c7d8b3e62 Mon Sep 17 00:00:00 2001 From: Niven Date: Sun, 26 Nov 2023 22:22:14 +0800 Subject: [PATCH 01/42] Add ccache into ci build-dev workflow, add caching --- .dockerignore | 1 + .github/workflows/build-dev.yaml | 48 ++++++++++++++++++++++++++++++-- .gitignore | 1 + make.sh | 5 +++- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 2e663fa609..243e9f09c8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,6 @@ .code .cache +.ccache .idea # Editors. diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 18ab636c4d..c36c6a695a 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -46,11 +46,24 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - - uses: Swatinem/rust-cache@v2 + + - name: Restore cpp build cache + id: cpp-cache-restore + uses: actions/cache/restore@v3 + with: + path: | + ./build/depends + ./build/src + ./build/.ccache + key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} + + - name: Restore rust build cache + uses: Swatinem/rust-cache@v2 + id: rust-cache-restore with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: rust-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - name: Build and package run: ./make.sh release @@ -61,6 +74,37 @@ jobs: name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} path: ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} + - name: Add debugging log to find ccache + run: ls -lahR ~ + + - name: Delete previous cpp cache + if: ${{ 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: Delete previous rust cache + if: ${{ steps.rust-cache-restore.outputs.cache-hit }} + continue-on-error: true + run: | + gh extension install actions/gh-actions-cache + gh actions-cache delete "${{ rust-${{ env.TARGET }}-${{ env.BUILD_TYPE }} }}" --confirm + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Save cpp cache + # if: ${{ github.ref == 'refs/heads/master' }} + uses: actions/cache/save@v3 + with: + path: | + ./build/depends + ./build/src + ./build/.ccache + key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} + docker-build: runs-on: ubuntu-latest needs: [build] diff --git a/.gitignore b/.gitignore index 967415998d..968cdb071a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .code .cache +.ccache .idea # Editors. diff --git a/make.sh b/make.sh index 832873a696..e6ab3fa149 100755 --- a/make.sh +++ b/make.sh @@ -689,7 +689,7 @@ pkg_install_deps() { software-properties-common build-essential git libtool autotools-dev automake \ pkg-config bsdmainutils python3 python3-pip python3-venv libssl-dev libevent-dev libboost-system-dev \ libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \ - libminiupnpc-dev libzmq3-dev libqrencode-dev wget \ + libminiupnpc-dev libzmq3-dev libqrencode-dev wget ccache \ libdb-dev libdb++-dev libdb5.3 libdb5.3-dev libdb5.3++ libdb5.3++-dev \ curl cmake zip unzip libc6-dev gcc-multilib locales locales-all @@ -1140,10 +1140,13 @@ _nproc() { # shellcheck disable=SC2129 ci_export_vars() { + local build_dir="${BUILD_DIR}" + if [[ -n "${GITHUB_ACTIONS-}" ]]; then # GitHub Actions echo "BUILD_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV" echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" + echo "CCACHE_DIR=${build_dir}/.ccache" echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV" if [[ "${TARGET}" == "x86_64-w64-mingw32" ]]; then echo "PKG_TYPE=zip" >> "$GITHUB_ENV" From 0884778be5f350ac11d3cbae01db5c53dddadb4d Mon Sep 17 00:00:00 2001 From: Niven Date: Sun, 26 Nov 2023 22:36:25 +0800 Subject: [PATCH 02/42] Fix build failure --- .github/workflows/build-dev.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index c36c6a695a..baee1bbb97 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -78,20 +78,20 @@ jobs: run: ls -lahR ~ - name: Delete previous cpp 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 "cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }}" --confirm env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Delete previous rust cache - if: ${{ steps.rust-cache-restore.outputs.cache-hit }} + if: ${{ github.ref == 'refs/heads/master' }} && ${{ steps.rust-cache-restore.outputs.cache-hit }} continue-on-error: true run: | gh extension install actions/gh-actions-cache - gh actions-cache delete "${{ rust-${{ env.TARGET }}-${{ env.BUILD_TYPE }} }}" --confirm + gh actions-cache delete "rust-${{ env.TARGET }}-${{ env.BUILD_TYPE }}" --confirm env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From adde74888f3b2e932036a3db05f68e80ed6edba4 Mon Sep 17 00:00:00 2001 From: Niven Date: Sun, 26 Nov 2023 22:37:31 +0800 Subject: [PATCH 03/42] Disable save if rust cache condition --- .github/workflows/build-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index baee1bbb97..67bda571be 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -62,7 +62,7 @@ jobs: id: rust-cache-restore with: workspaces: lib -> ../build/lib/target - save-if: ${{ github.ref == 'refs/heads/master' }} + # save-if: ${{ github.ref == 'refs/heads/master' }} shared-key: rust-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - name: Build and package From 53f6bd880e8d772f1a7668bfeb89f1e34a85a615 Mon Sep 17 00:00:00 2001 From: Niven Date: Sun, 26 Nov 2023 22:43:07 +0800 Subject: [PATCH 04/42] Add build type --- make.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/make.sh b/make.sh index e6ab3fa149..9e108f8ccb 100755 --- a/make.sh +++ b/make.sh @@ -1148,6 +1148,13 @@ ci_export_vars() { echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" echo "CCACHE_DIR=${build_dir}/.ccache" echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV" + + if [[ "${MAKE_DEBUG}" == "1" ]]; then + echo "BUILD_TYPE=debug" >> "$GITHUB_ENV" + else + echo "BUILD_TYPE=release" >> "$GITHUB_ENV" + fi + if [[ "${TARGET}" == "x86_64-w64-mingw32" ]]; then echo "PKG_TYPE=zip" >> "$GITHUB_ENV" else From c03998c79684953dba6e3e2a80f440a1f87e628a Mon Sep 17 00:00:00 2001 From: Niven Date: Sun, 26 Nov 2023 22:54:22 +0800 Subject: [PATCH 05/42] Revert rust cache --- .github/workflows/build-dev.yaml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 67bda571be..5640131c15 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -46,7 +46,7 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - + - name: Restore cpp build cache id: cpp-cache-restore uses: actions/cache/restore@v3 @@ -57,13 +57,10 @@ jobs: ./build/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - - name: Restore rust build cache - uses: Swatinem/rust-cache@v2 - id: rust-cache-restore + - uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target - # save-if: ${{ github.ref == 'refs/heads/master' }} - shared-key: rust-${{ env.TARGET }}-${{ env.BUILD_TYPE }} + save-if: ${{ github.ref == 'refs/heads/master' }} - name: Build and package run: ./make.sh release @@ -86,15 +83,6 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Delete previous rust cache - if: ${{ github.ref == 'refs/heads/master' }} && ${{ steps.rust-cache-restore.outputs.cache-hit }} - continue-on-error: true - run: | - gh extension install actions/gh-actions-cache - gh actions-cache delete "rust-${{ env.TARGET }}-${{ env.BUILD_TYPE }}" --confirm - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Save cpp cache # if: ${{ github.ref == 'refs/heads/master' }} uses: actions/cache/save@v3 From b308b573e141718213cb3271263e94159b4ad25d Mon Sep 17 00:00:00 2001 From: Niven Date: Sun, 26 Nov 2023 23:03:00 +0800 Subject: [PATCH 06/42] Remove rust caching from release and staging --- .github/workflows/build-release.yaml | 5 ----- .github/workflows/build-staging.yaml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 6c4cba3507..5b1f2509f2 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -35,11 +35,6 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - uses: Swatinem/rust-cache@v2 - with: - workspaces: lib -> ../build/lib/target - save-if: ${{ github.ref == 'refs/heads/master' }} - - name: Build and package run: ./make.sh release diff --git a/.github/workflows/build-staging.yaml b/.github/workflows/build-staging.yaml index c75c626ca3..e3f9b040e1 100644 --- a/.github/workflows/build-staging.yaml +++ b/.github/workflows/build-staging.yaml @@ -33,11 +33,6 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - uses: Swatinem/rust-cache@v2 - with: - workspaces: lib -> ../build/lib/target - save-if: ${{ github.ref == 'refs/heads/master' }} - - name: Build and package run: ./make.sh release From 992b4f1ea2d5f40d9764f762c83a4df7f235644e Mon Sep 17 00:00:00 2001 From: Niven Date: Sun, 26 Nov 2023 23:06:24 +0800 Subject: [PATCH 07/42] Add shared key to rust cache --- .github/workflows/build-dev.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 5640131c15..8739b7ecf2 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -46,7 +46,7 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - + - name: Restore cpp build cache id: cpp-cache-restore uses: actions/cache/restore@v3 @@ -57,10 +57,13 @@ jobs: ./build/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - - uses: Swatinem/rust-cache@v2 + - name: Restore rust build cache + uses: Swatinem/rust-cache@v2 + id: rust-cache-restore with: workspaces: lib -> ../build/lib/target - save-if: ${{ github.ref == 'refs/heads/master' }} + # save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: ${{ env.TARGET }} - name: Build and package run: ./make.sh release From fc36f53a78290776e62c62e418735a0fc9b068a9 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 00:29:17 +0800 Subject: [PATCH 08/42] Fix ccache and rust cache key --- .github/workflows/build-dev.yaml | 6 +++--- .github/workflows/lint.yaml | 4 +++- .github/workflows/tests-ethlibs.yaml | 5 ++++- .github/workflows/tests-frontier.yml | 5 ++++- .github/workflows/tests-sync.yml | 5 ++++- .github/workflows/tests.yaml | 10 ++++++++-- make.sh | 1 - 7 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 8739b7ecf2..87243d6984 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -54,7 +54,7 @@ jobs: path: | ./build/depends ./build/src - ./build/.ccache + ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - name: Restore rust build cache @@ -62,7 +62,7 @@ jobs: id: rust-cache-restore with: workspaces: lib -> ../build/lib/target - # save-if: ${{ github.ref == 'refs/heads/master' }} + save-if: ${{ github.ref == 'refs/heads/master' }} shared-key: ${{ env.TARGET }} - name: Build and package @@ -93,7 +93,7 @@ jobs: path: | ./build/depends ./build/src - ./build/.ccache + ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} docker-build: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index da86d4ef83..ff38eb1440 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -57,10 +57,12 @@ jobs: - name: Setup dependencies for user run: ./make.sh ci-setup-user-deps - - uses: Swatinem/rust-cache@v2 + - name: Restore rust build cache + uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: ${{ env.TARGET }} - name: Build depends and configure run: ./make.sh build-deps && ./make.sh build-conf diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index 1bdf74a8f4..b461ed688f 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -38,10 +38,13 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - uses: Swatinem/rust-cache@v2 + - name: Restore rust build cache + uses: Swatinem/rust-cache@v2 + id: rust-cache-restore with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: ${{ env.TARGET }} - name: Build binaries run: ./make.sh build diff --git a/.github/workflows/tests-frontier.yml b/.github/workflows/tests-frontier.yml index fd389b0152..9007698a06 100644 --- a/.github/workflows/tests-frontier.yml +++ b/.github/workflows/tests-frontier.yml @@ -30,10 +30,13 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - uses: Swatinem/rust-cache@v2 + - name: Restore rust build cache + uses: Swatinem/rust-cache@v2 + id: rust-cache-restore with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: ${{ env.TARGET }} - name: Build binaries run: ./make.sh build diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index 22fde03602..8ce3a279ea 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -40,10 +40,13 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - uses: Swatinem/rust-cache@v2 + - name: Restore rust build cache + uses: Swatinem/rust-cache@v2 + id: rust-cache-restore with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: ${{ env.TARGET }} - name: Build binaries run: ./make.sh build diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index faaf4ff257..983500b879 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -45,10 +45,13 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - uses: Swatinem/rust-cache@v2 + - name: Restore rust build cache + uses: Swatinem/rust-cache@v2 + id: rust-cache-restore with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: ${{ env.TARGET }} - name: Build binaries run: ./make.sh build @@ -76,10 +79,13 @@ jobs: - name: Setup dependencies for user run: ./make.sh ci-setup-user-deps - - uses: Swatinem/rust-cache@v2 + - name: Restore rust build cache + uses: Swatinem/rust-cache@v2 + id: rust-cache-restore with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: ${{ env.TARGET }} - name: Build deps and configure run: ./make.sh build-deps && ./make.sh build-conf diff --git a/make.sh b/make.sh index 9e108f8ccb..4ee2ebee9c 100755 --- a/make.sh +++ b/make.sh @@ -1146,7 +1146,6 @@ ci_export_vars() { # GitHub Actions echo "BUILD_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV" echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" - echo "CCACHE_DIR=${build_dir}/.ccache" echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV" if [[ "${MAKE_DEBUG}" == "1" ]]; then From c673a2016fb7141d4779a7681fa6b527bcfb846b Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 00:29:45 +0800 Subject: [PATCH 09/42] Switch debugging log --- .github/workflows/build-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 87243d6984..cc7e35f2db 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -75,7 +75,7 @@ jobs: path: ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} - name: Add debugging log to find ccache - run: ls -lahR ~ + run: ls -lahR ./build - name: Delete previous cpp cache if: ${{ github.ref == 'refs/heads/master' }} && ${{ steps.cpp-cache-restore.outputs.cache-hit }} From 4a0b02c0ac0142f7f3d04d2305ce1c89a5d10a6c Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 00:30:06 +0800 Subject: [PATCH 10/42] Explicitly set ccache_dir --- make.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/make.sh b/make.sh index 4ee2ebee9c..9e108f8ccb 100755 --- a/make.sh +++ b/make.sh @@ -1146,6 +1146,7 @@ ci_export_vars() { # GitHub Actions echo "BUILD_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV" echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" + echo "CCACHE_DIR=${build_dir}/.ccache" echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV" if [[ "${MAKE_DEBUG}" == "1" ]]; then From 6b6ee7c98ab22395a7b0f2bb56518b8ba114b75c Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 00:31:12 +0800 Subject: [PATCH 11/42] Disable delete cpp cache on master --- .github/workflows/build-dev.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index cc7e35f2db..a511388d7d 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -78,7 +78,8 @@ jobs: run: ls -lahR ./build - name: Delete previous cpp cache - if: ${{ github.ref == 'refs/heads/master' }} && ${{ steps.cpp-cache-restore.outputs.cache-hit }} + # if: ${{ github.ref == 'refs/heads/master' }} && ${{ steps.cpp-cache-restore.outputs.cache-hit }} + if: ${{ steps.cpp-cache-restore.outputs.cache-hit }} continue-on-error: true run: | gh extension install actions/gh-actions-cache From c8e4f6cee0f17a594ef6c374c17b118d4aa59752 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 00:38:06 +0800 Subject: [PATCH 12/42] Fix make.sh --- make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.sh b/make.sh index 9e108f8ccb..a6a6cc97f1 100755 --- a/make.sh +++ b/make.sh @@ -1146,7 +1146,7 @@ ci_export_vars() { # GitHub Actions echo "BUILD_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV" echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" - echo "CCACHE_DIR=${build_dir}/.ccache" + echo "CCACHE_DIR=${build_dir}/.ccache" >> "$GITHUB_ENV" echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV" if [[ "${MAKE_DEBUG}" == "1" ]]; then From e9439931a506d3690d533cacb3ddfee2242e4402 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 00:38:52 +0800 Subject: [PATCH 13/42] Fix ccache dir --- .github/workflows/build-dev.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index a511388d7d..62e3e7e409 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -54,7 +54,7 @@ jobs: path: | ./build/depends ./build/src - ~/.ccache + ./build/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - name: Restore rust build cache @@ -94,7 +94,7 @@ jobs: path: | ./build/depends ./build/src - ~/.ccache + ./build/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} docker-build: From 0786d24afaa37d29b5c33775309df4944aadc9a6 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 01:07:36 +0800 Subject: [PATCH 14/42] Fix ccache dir --- .github/workflows/build-dev.yaml | 7 ++----- make.sh | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 62e3e7e409..c8891bc495 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -54,7 +54,7 @@ jobs: path: | ./build/depends ./build/src - ./build/.ccache + ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - name: Restore rust build cache @@ -74,9 +74,6 @@ jobs: name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} path: ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} - - name: Add debugging log to find ccache - run: ls -lahR ./build - - name: Delete previous cpp cache # if: ${{ github.ref == 'refs/heads/master' }} && ${{ steps.cpp-cache-restore.outputs.cache-hit }} if: ${{ steps.cpp-cache-restore.outputs.cache-hit }} @@ -94,7 +91,7 @@ jobs: path: | ./build/depends ./build/src - ./build/.ccache + ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} docker-build: diff --git a/make.sh b/make.sh index a6a6cc97f1..4ee2ebee9c 100755 --- a/make.sh +++ b/make.sh @@ -1146,7 +1146,6 @@ ci_export_vars() { # GitHub Actions echo "BUILD_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV" echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV" - echo "CCACHE_DIR=${build_dir}/.ccache" >> "$GITHUB_ENV" echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV" if [[ "${MAKE_DEBUG}" == "1" ]]; then From 76abfdb99edc120180b33eca1fd997311a2c41b9 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 01:38:08 +0800 Subject: [PATCH 15/42] Disable save if on rust cache --- .github/workflows/build-dev.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index c8891bc495..3fc33febb4 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -43,10 +43,10 @@ jobs: - name: Setup dependencies run: ./make.sh ci-setup-deps - + - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - + - name: Restore cpp build cache id: cpp-cache-restore uses: actions/cache/restore@v3 @@ -62,7 +62,7 @@ jobs: id: rust-cache-restore with: workspaces: lib -> ../build/lib/target - save-if: ${{ github.ref == 'refs/heads/master' }} + # save-if: ${{ github.ref == 'refs/heads/master' }} shared-key: ${{ env.TARGET }} - name: Build and package From f9b445b9f607bba010050568697776596f44d6d9 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 02:02:26 +0800 Subject: [PATCH 16/42] Add gh deps --- make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.sh b/make.sh index 4ee2ebee9c..2a283d6936 100755 --- a/make.sh +++ b/make.sh @@ -689,7 +689,7 @@ pkg_install_deps() { software-properties-common build-essential git libtool autotools-dev automake \ pkg-config bsdmainutils python3 python3-pip python3-venv libssl-dev libevent-dev libboost-system-dev \ libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \ - libminiupnpc-dev libzmq3-dev libqrencode-dev wget ccache \ + libminiupnpc-dev libzmq3-dev libqrencode-dev wget gh ccache \ libdb-dev libdb++-dev libdb5.3 libdb5.3-dev libdb5.3++ libdb5.3++-dev \ curl cmake zip unzip libc6-dev gcc-multilib locales locales-all From 29a9762941f5fc65e9ab9f93714b4bb404a61867 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 02:07:30 +0800 Subject: [PATCH 17/42] Fix base deps --- make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.sh b/make.sh index 2a283d6936..4ee2ebee9c 100755 --- a/make.sh +++ b/make.sh @@ -689,7 +689,7 @@ pkg_install_deps() { software-properties-common build-essential git libtool autotools-dev automake \ pkg-config bsdmainutils python3 python3-pip python3-venv libssl-dev libevent-dev libboost-system-dev \ libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \ - libminiupnpc-dev libzmq3-dev libqrencode-dev wget gh ccache \ + libminiupnpc-dev libzmq3-dev libqrencode-dev wget ccache \ libdb-dev libdb++-dev libdb5.3 libdb5.3-dev libdb5.3++ libdb5.3++-dev \ curl cmake zip unzip libc6-dev gcc-multilib locales locales-all From d9741b82867ebc9c8e0768109ce728f3f9547cff Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 08:17:27 +0800 Subject: [PATCH 18/42] Use cpp caching to all workflows --- .github/workflows/build-dev.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/tests-ethlibs.yaml | 12 +++++++++++- .github/workflows/tests-frontier.yml | 16 +++++++++++++++- .github/workflows/tests-sync.yml | 16 +++++++++++++++- .github/workflows/tests.yaml | 18 ++++++++++++++++-- 6 files changed, 59 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 3fc33febb4..8685a168a6 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -57,7 +57,7 @@ jobs: ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - - name: Restore rust build cache + - name: Rust cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ff38eb1440..62704dac60 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -57,7 +57,7 @@ jobs: - name: Setup dependencies for user run: ./make.sh ci-setup-user-deps - - name: Restore rust build cache + - name: Rust cache uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index b461ed688f..517f1b24a7 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -38,7 +38,17 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - name: Restore rust build cache + - 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: Rust cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: diff --git a/.github/workflows/tests-frontier.yml b/.github/workflows/tests-frontier.yml index 9007698a06..5a5d7659e7 100644 --- a/.github/workflows/tests-frontier.yml +++ b/.github/workflows/tests-frontier.yml @@ -10,6 +10,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} +env: + TARGET: x86_64-pc-linux-gnu + MAKE_DEBUG: 0 + jobs: build: runs-on: ubuntu-latest @@ -30,7 +34,17 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - name: Restore rust build cache + - 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: Rust cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index 8ce3a279ea..b9b9e0d70c 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -21,6 +21,10 @@ concurrency: run-name: ${{ inputs.name || github.event.pull_request.title || github.ref_name }} +env: + TARGET: x86_64-pc-linux-gnu + MAKE_DEBUG: 0 + jobs: build: if: contains(github.event.pull_request.labels.*.name, 'ci/sync') || github.event_name == 'workflow_dispatch' @@ -40,7 +44,17 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - name: Restore rust build cache + - 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: Rust cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 983500b879..a2c6e46e4e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,6 +15,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} +env: + TARGET: x86_64-pc-linux-gnu + MAKE_DEBUG: 0 + jobs: e2e-tests: runs-on: ubuntu-latest @@ -45,7 +49,17 @@ jobs: - name: Setup user dependencies run: ./make.sh ci-setup-user-deps - - name: Restore rust build cache + - 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: Rust cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: @@ -79,7 +93,7 @@ jobs: - name: Setup dependencies for user run: ./make.sh ci-setup-user-deps - - name: Restore rust build cache + - name: Rust cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: From cfcf99b3e7f5fc2a377ac18ca90a988a080d8a5c Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 08:58:51 +0800 Subject: [PATCH 19/42] Install gh deps on ci setup deps --- make.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/make.sh b/make.sh index 4ee2ebee9c..c3c161a032 100755 --- a/make.sh +++ b/make.sh @@ -743,6 +743,21 @@ pkg_install_deps_osx_tools() { _fold_end } +pkg_install_gh_cli() { + _fold_start "pkg-install-gh_cli" + type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | \ + sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \ + sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) \ + signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] \ + https://cli.github.com/packages stable main" | \ + sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + apt-get update + apt-get install -y gh + +} + pkg_install_llvm() { _fold_start "pkg-install-llvm" # shellcheck disable=SC2086 @@ -1167,6 +1182,7 @@ ci_setup_deps() { DEBIAN_FRONTEND=noninteractive pkg_install_deps DEBIAN_FRONTEND=noninteractive pkg_setup_locale DEBIAN_FRONTEND=noninteractive pkg_install_llvm + DEBIAN_FRONTEND=noninteractive pkg_install_gh_cli ci_setup_deps_target } From ab6cb01d38d47ac3a6a2cc5d3e7d1e7d9b11fba5 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 09:02:47 +0800 Subject: [PATCH 20/42] Make.sh fixes --- make.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/make.sh b/make.sh index c3c161a032..9bd739b2b9 100755 --- a/make.sh +++ b/make.sh @@ -745,14 +745,13 @@ pkg_install_deps_osx_tools() { pkg_install_gh_cli() { _fold_start "pkg-install-gh_cli" - type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | \ - sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \ - sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg + dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \ + chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) \ signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] \ https://cli.github.com/packages stable main" | \ - sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + tee /etc/apt/sources.list.d/github-cli.list > /dev/null apt-get update apt-get install -y gh From c1b5776d5cb40bfab870fb5aab7a07b99215e8f3 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 09:11:28 +0800 Subject: [PATCH 21/42] Enable save only on master in build dev --- .github/workflows/build-dev.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 8685a168a6..e682275fa1 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -62,7 +62,7 @@ jobs: id: rust-cache-restore with: workspaces: lib -> ../build/lib/target - # save-if: ${{ github.ref == 'refs/heads/master' }} + save-if: ${{ github.ref == 'refs/heads/master' }} shared-key: ${{ env.TARGET }} - name: Build and package @@ -75,8 +75,7 @@ jobs: 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 }} - 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 @@ -85,7 +84,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Save cpp cache - # if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ github.ref == 'refs/heads/master' }} uses: actions/cache/save@v3 with: path: | From 199d9d05aa18be8f6620997ba9f798391185a796 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 09:23:33 +0800 Subject: [PATCH 22/42] Better rename --- .github/workflows/build-dev.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/tests-ethlibs.yaml | 2 +- .github/workflows/tests-frontier.yml | 2 +- .github/workflows/tests-sync.yml | 2 +- .github/workflows/tests.yaml | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index e682275fa1..6931a16251 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -57,7 +57,7 @@ jobs: ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - - name: Rust cache + - name: Rust build cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 62704dac60..925f8a964c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -57,7 +57,7 @@ jobs: - name: Setup dependencies for user run: ./make.sh ci-setup-user-deps - - name: Rust cache + - name: Rust build cache uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index 517f1b24a7..4f4b0223da 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -48,7 +48,7 @@ jobs: ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - - name: Rust cache + - name: Rust build cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: diff --git a/.github/workflows/tests-frontier.yml b/.github/workflows/tests-frontier.yml index 5a5d7659e7..e47ce17e62 100644 --- a/.github/workflows/tests-frontier.yml +++ b/.github/workflows/tests-frontier.yml @@ -44,7 +44,7 @@ jobs: ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - - name: Rust cache + - name: Rust build cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index b9b9e0d70c..de84adffc3 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -54,7 +54,7 @@ jobs: ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - - name: Rust cache + - name: Rust build cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a2c6e46e4e..b214875661 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -59,7 +59,7 @@ jobs: ~/.ccache key: cpp-${{ env.TARGET }}-${{ env.BUILD_TYPE }} - - name: Rust cache + - name: Rust build cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: @@ -93,7 +93,7 @@ jobs: - name: Setup dependencies for user run: ./make.sh ci-setup-user-deps - - name: Rust cache + - name: Rust build cache uses: Swatinem/rust-cache@v2 id: rust-cache-restore with: From 37d4859538ec46724d84f31eeca20e85f58972fb Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 09:51:46 +0800 Subject: [PATCH 23/42] Fix if condition --- .github/workflows/build-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 6931a16251..2efb8cc0b3 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -75,7 +75,7 @@ jobs: 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 }} + 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 From b7be2967c1c5f6dac9c9fd1bd669f8c116a6cb0d Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 09:52:36 +0800 Subject: [PATCH 24/42] Enable cpp save --- .github/workflows/build-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 2efb8cc0b3..ded873d401 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -84,7 +84,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Save cpp cache - if: ${{ github.ref == 'refs/heads/master' }} + # if: ${{ github.ref == 'refs/heads/master' }} uses: actions/cache/save@v3 with: path: | From d4aa675fe3b5b8cd21a1ac81ac47091bc4cda562 Mon Sep 17 00:00:00 2001 From: Niven Date: Mon, 27 Nov 2023 10:25:54 +0800 Subject: [PATCH 25/42] Enable save cache condition check --- .github/workflows/build-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index ded873d401..2efb8cc0b3 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -84,7 +84,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Save cpp cache - # if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ github.ref == 'refs/heads/master' }} uses: actions/cache/save@v3 with: path: | From 809e99b34557a615e6f30cf0ae7e212412916cdd Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 12:43:28 +0800 Subject: [PATCH 26/42] Switch to set-safe-directory setting --- .github/workflows/build-dev.yaml | 4 ++-- .github/workflows/build-release.yaml | 4 ++-- .github/workflows/build-staging.yaml | 4 ++-- .github/workflows/lint.yaml | 3 ++- .github/workflows/tests-ethlibs.yaml | 3 ++- .github/workflows/tests-frontier.yml | 3 ++- .github/workflows/tests-sync.yml | 5 ++--- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 2efb8cc0b3..3a2c4d7235 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -36,7 +36,8 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' + with: + set-safe-directory: '*' - name: Populate environment run: ./make.sh ci-export-vars @@ -101,7 +102,6 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 5b1f2509f2..5b7c7d8357 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -24,7 +24,8 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' + with: + set-safe-directory: '*' - name: Populate environment run: ./make.sh ci-export-vars @@ -80,7 +81,6 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/build-staging.yaml b/.github/workflows/build-staging.yaml index e3f9b040e1..95d7fb9c47 100644 --- a/.github/workflows/build-staging.yaml +++ b/.github/workflows/build-staging.yaml @@ -22,7 +22,8 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' + with: + set-safe-directory: '*' - name: Populate environment run: ./make.sh ci-export-vars @@ -52,7 +53,6 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 925f8a964c..74cdc9cf3b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -46,7 +46,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' + with: + set-safe-directory: '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index 4f4b0223da..b836156063 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -27,7 +27,8 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' + with: + set-safe-directory: '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/tests-frontier.yml b/.github/workflows/tests-frontier.yml index e47ce17e62..7ebac142d2 100644 --- a/.github/workflows/tests-frontier.yml +++ b/.github/workflows/tests-frontier.yml @@ -23,7 +23,8 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' + with: + set-safe-directory: '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index de84adffc3..40ee19ccb7 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -33,7 +33,8 @@ jobs: CARGO_INCREMENTAL: 0 steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' + with: + set-safe-directory: '*' - name: Populate environment run: ./make.sh ci-export-vars @@ -93,7 +94,6 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' - id: 'auth' name: 'Authenticate to Google Cloud' @@ -137,7 +137,6 @@ jobs: steps: - uses: actions/checkout@v4 - - run: git config --global --add safe.directory '*' - name: Download Snapshot run: aria2c -x16 -s16 https://storage.googleapis.com/team-drop/master-datadir/datadir-${{matrix.blocks.start}}.tar.gz From ffebf7e6531d9a5871e71d91edd044e2865741cc Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 12:55:14 +0800 Subject: [PATCH 27/42] Revert from set safe directory --- .github/workflows/build-dev.yaml | 3 +-- .github/workflows/build-release.yaml | 3 +-- .github/workflows/build-staging.yaml | 3 +-- .github/workflows/lint.yaml | 3 +-- .github/workflows/tests-ethlibs.yaml | 3 +-- .github/workflows/tests-frontier.yml | 3 +-- .github/workflows/tests-sync.yml | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 3a2c4d7235..8444a19280 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -36,8 +36,7 @@ jobs: steps: - uses: actions/checkout@v4 - with: - set-safe-directory: '*' + - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 5b7c7d8357..1dca11579e 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -24,8 +24,7 @@ jobs: steps: - uses: actions/checkout@v4 - with: - set-safe-directory: '*' + - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/build-staging.yaml b/.github/workflows/build-staging.yaml index 95d7fb9c47..c080f02848 100644 --- a/.github/workflows/build-staging.yaml +++ b/.github/workflows/build-staging.yaml @@ -22,8 +22,7 @@ jobs: steps: - uses: actions/checkout@v4 - with: - set-safe-directory: '*' + - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 74cdc9cf3b..925f8a964c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -46,8 +46,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - set-safe-directory: '*' + - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/tests-ethlibs.yaml b/.github/workflows/tests-ethlibs.yaml index b836156063..4f4b0223da 100644 --- a/.github/workflows/tests-ethlibs.yaml +++ b/.github/workflows/tests-ethlibs.yaml @@ -27,8 +27,7 @@ jobs: steps: - uses: actions/checkout@v4 - with: - set-safe-directory: '*' + - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/tests-frontier.yml b/.github/workflows/tests-frontier.yml index 7ebac142d2..e47ce17e62 100644 --- a/.github/workflows/tests-frontier.yml +++ b/.github/workflows/tests-frontier.yml @@ -23,8 +23,7 @@ jobs: steps: - uses: actions/checkout@v4 - with: - set-safe-directory: '*' + - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index 40ee19ccb7..45e3d52277 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -33,8 +33,7 @@ jobs: CARGO_INCREMENTAL: 0 steps: - uses: actions/checkout@v4 - with: - set-safe-directory: '*' + - run: git config --global --add safe.directory '*' - name: Populate environment run: ./make.sh ci-export-vars From f1b97602a52c2fb556d6f192807ca31338c72942 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 13:16:20 +0800 Subject: [PATCH 28/42] Unpack package and port into docker image instead --- .github/workflows/build-dev.yaml | 6 +++++- .github/workflows/build-release.yaml | 2 +- .github/workflows/build-staging.yaml | 2 +- .github/workflows/tests-sync.yml | 2 +- contrib/dockerfiles/defi.dockerfile | 5 ++--- make.sh | 8 +++++--- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 8444a19280..eb619c6bd6 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -105,10 +105,14 @@ jobs: - name: Populate environment run: ./make.sh ci-export-vars - - name: Download Binaries + - name: Download binaries uses: actions/download-artifact@v3 with: name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} + path: ./build/ + + - name: Unpack binaries + run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} - name: Build defi image run: rm .dockerignore && ./make.sh docker-defi-build diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 1dca11579e..e641669ccc 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -84,7 +84,7 @@ jobs: - name: Populate environment run: ./make.sh ci-export-vars - - name: Download Binaries + - name: Download binaries uses: actions/download-artifact@v3 with: name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} diff --git a/.github/workflows/build-staging.yaml b/.github/workflows/build-staging.yaml index c080f02848..0bd82f68d1 100644 --- a/.github/workflows/build-staging.yaml +++ b/.github/workflows/build-staging.yaml @@ -56,7 +56,7 @@ jobs: - name: Populate environment run: ./make.sh ci-export-vars - - name: Download Binaries + - name: Download binaries uses: actions/download-artifact@v3 with: name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} diff --git a/.github/workflows/tests-sync.yml b/.github/workflows/tests-sync.yml index 45e3d52277..0bca0d17ee 100644 --- a/.github/workflows/tests-sync.yml +++ b/.github/workflows/tests-sync.yml @@ -143,7 +143,7 @@ jobs: - name: Create datadir run: mkdir $DATADIR && tar -C $DATADIR -xvf datadir-${{matrix.blocks.start}}.tar.gz - - name: Download Binaries + - name: Download binaries uses: actions/download-artifact@v3 with: name: defi-bins diff --git a/contrib/dockerfiles/defi.dockerfile b/contrib/dockerfiles/defi.dockerfile index 40db80d80a..301aca232d 100644 --- a/contrib/dockerfiles/defi.dockerfile +++ b/contrib/dockerfiles/defi.dockerfile @@ -2,14 +2,13 @@ ARG TARGET=x86_64-pc-linux-gnu FROM --platform=linux/amd64 ubuntu:latest as defi ARG TARGET -ARG PACKAGE +ARG BINARY_DIR ENV PATH=/app/bin:$PATH LABEL org.defichain.name="defichain" LABEL org.defichain.arch=${TARGET} WORKDIR /app -COPY ${PACKAGE} ./ -RUN tar -xvzf ${PACKAGE} --strip-components 1 +COPY ${BINARY_DIR} ./ RUN useradd --create-home defi && \ mkdir -p /data && \ diff --git a/make.sh b/make.sh index 9bd739b2b9..080f66bde1 100755 --- a/make.sh +++ b/make.sh @@ -324,8 +324,7 @@ docker_defi_build() { local target=${1:-${TARGET}} local img_prefix="${IMAGE_PREFIX}" local img_version="${IMAGE_VERSION}" - - local pkg_name="${img_prefix}-${img_version}-${target}.tar.gz" + local build_dir="${BUILD_DIR}" local docker_context="${DOCKER_ROOT_CONTEXT}" local docker_file="${DEFI_DOCKERFILE}" @@ -336,8 +335,11 @@ docker_defi_build() { echo "> building: ${img}" echo "> docker defi build: ${img}" + local versioned_name="${img_prefix}-${img_version}" + local versioned_build_dir="${build_dir}/${versioned_name}" + docker build -f "${docker_file}" \ - --build-arg PACKAGE="${pkg_name}" \ + --build-arg BINARY_DIR="${versioned_build_dir}" \ -t "${img}" "${docker_context}" } From 6b67dd8e96bd97b4ea16c8504505008ea8d44f9b Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 13:17:44 +0800 Subject: [PATCH 29/42] Add debugging log --- .github/workflows/build-dev.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index eb619c6bd6..4f27275eb1 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -114,6 +114,9 @@ jobs: - name: Unpack binaries run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} + - name: Add debug logging + run: ls -lahR . + - name: Build defi image run: rm .dockerignore && ./make.sh docker-defi-build From b674f08c0a7bf2d56c10e496d9d1d1fd8e0acd64 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 13:42:04 +0800 Subject: [PATCH 30/42] Fix tar command --- .github/workflows/build-dev.yaml | 5 +---- .github/workflows/build-release.yaml | 4 ++++ .github/workflows/build-staging.yaml | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 4f27275eb1..96d0c1adc4 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -112,10 +112,7 @@ jobs: path: ./build/ - name: Unpack binaries - run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} - - - name: Add debug logging - run: ls -lahR . + run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} -C ./build/ - name: Build defi image run: rm .dockerignore && ./make.sh docker-defi-build diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index e641669ccc..439003c085 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -88,6 +88,10 @@ jobs: uses: actions/download-artifact@v3 with: name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} + path: ./build/ + + - name: Unpack binaries + run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} -C ./build/ - name: Build defi image run: rm .dockerignore && ./make.sh docker-defi-build diff --git a/.github/workflows/build-staging.yaml b/.github/workflows/build-staging.yaml index 0bd82f68d1..721e591f7c 100644 --- a/.github/workflows/build-staging.yaml +++ b/.github/workflows/build-staging.yaml @@ -60,6 +60,10 @@ jobs: uses: actions/download-artifact@v3 with: name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} + path: ./build/ + + - name: Unpack binaries + run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} -C ./build/ - name: Build defi image run: rm .dockerignore && ./make.sh docker-defi-build From a45beda019b845ceef01a671e26bd62df7301cd7 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 13:43:55 +0800 Subject: [PATCH 31/42] Resave cache --- .github/workflows/build-dev.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 96d0c1adc4..a87ba4c429 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -75,7 +75,8 @@ jobs: 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 }} + 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 @@ -84,7 +85,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Save cpp cache - if: ${{ github.ref == 'refs/heads/master' }} + # if: ${{ github.ref == 'refs/heads/master' }} uses: actions/cache/save@v3 with: path: | From 16c92026a904ca8d1e14084d08c26c4b16f02bda Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 14:06:03 +0800 Subject: [PATCH 32/42] Save only on master --- .github/workflows/build-dev.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index a87ba4c429..96d0c1adc4 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -75,8 +75,7 @@ jobs: path: ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} - name: Delete previous cpp cache - if: ${{ steps.cpp-cache-restore.outputs.cache-hit }} - # if: ${{ github.ref == 'refs/heads/master' && 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 @@ -85,7 +84,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Save cpp cache - # if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ github.ref == 'refs/heads/master' }} uses: actions/cache/save@v3 with: path: | From 40f679f4c5934db7376c60877313f7b7b9268471 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 14:09:49 +0800 Subject: [PATCH 33/42] Pass binary dir relative to docker root context --- make.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make.sh b/make.sh index 080f66bde1..87b6e86331 100755 --- a/make.sh +++ b/make.sh @@ -18,6 +18,7 @@ setup_vars() { fi DOCKER_ROOT_CONTEXT=${DOCKER_ROOT_CONTEXT:-"."} + DOCKER_RELATIVE_BUILD_DIR=${DOCKER_RELATIVE_BUILD_DIR:-"./build"} DOCKERFILES_DIR=${DOCKERFILES_DIR:-"./contrib/dockerfiles"} DEFI_DOCKERFILE=${DEFI_DOCKERFILE:-"${DOCKERFILES_DIR}/defi.dockerfile"} @@ -324,7 +325,7 @@ docker_defi_build() { local target=${1:-${TARGET}} local img_prefix="${IMAGE_PREFIX}" local img_version="${IMAGE_VERSION}" - local build_dir="${BUILD_DIR}" + local build_dir="${DOCKER_RELATIVE_BUILD_DIR}" local docker_context="${DOCKER_ROOT_CONTEXT}" local docker_file="${DEFI_DOCKERFILE}" From 95b39b358f51312e576e0210a4fadd4462108ba8 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 14:34:16 +0800 Subject: [PATCH 34/42] Save rust cache separately for lint --- .github/workflows/lint.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 925f8a964c..f8551bcf54 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -62,7 +62,6 @@ jobs: with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} - shared-key: ${{ env.TARGET }} - name: Build depends and configure run: ./make.sh build-deps && ./make.sh build-conf From 2e6cb880855c4d31e35ec157799141b8dbfb598a Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 14:35:20 +0800 Subject: [PATCH 35/42] Better shared key naming --- .github/workflows/lint.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f8551bcf54..022207c6cf 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -38,7 +38,7 @@ jobs: run: ./ci/extended_lint/main.sh rust: - name: Rust Lints + name: Rust Lint runs-on: ubuntu-latest container: defi/ain-builder:latest env: @@ -62,6 +62,7 @@ jobs: with: workspaces: lib -> ../build/lib/target save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: rust-lint - name: Build depends and configure run: ./make.sh build-deps && ./make.sh build-conf From 389a1f4838c889d34623bb672a2d50a3b51c3e36 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 14:35:52 +0800 Subject: [PATCH 36/42] Save cache --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 022207c6cf..e8707e5a3d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -61,7 +61,7 @@ jobs: uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target - save-if: ${{ github.ref == 'refs/heads/master' }} + # save-if: ${{ github.ref == 'refs/heads/master' }} shared-key: rust-lint - name: Build depends and configure From 183f5294b6c782bee29d37b0be32e72304fc14db Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 14:40:38 +0800 Subject: [PATCH 37/42] Re-enable save only on master for rust lint --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e8707e5a3d..022207c6cf 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -61,7 +61,7 @@ jobs: uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target - # save-if: ${{ github.ref == 'refs/heads/master' }} + save-if: ${{ github.ref == 'refs/heads/master' }} shared-key: rust-lint - name: Build depends and configure From 7529d36f559422479dcf34d181fb9536278db4a0 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 14:54:34 +0800 Subject: [PATCH 38/42] Better rename --- .github/workflows/lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 022207c6cf..ad4480f487 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -61,8 +61,8 @@ jobs: uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target - save-if: ${{ github.ref == 'refs/heads/master' }} - shared-key: rust-lint + # save-if: ${{ github.ref == 'refs/heads/master' }} + shared-key: lint - name: Build depends and configure run: ./make.sh build-deps && ./make.sh build-conf From 889869c584d96749b9e8892c0b22e041ffa8af47 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 14:55:32 +0800 Subject: [PATCH 39/42] Re-enable save only on master --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ad4480f487..1b61802d85 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -61,7 +61,7 @@ jobs: uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target - # save-if: ${{ github.ref == 'refs/heads/master' }} + save-if: ${{ github.ref == 'refs/heads/master' }} shared-key: lint - name: Build depends and configure From 0459cb1a9ec01a9b65b3452be00f87c5ac361536 Mon Sep 17 00:00:00 2001 From: Niven Date: Wed, 29 Nov 2023 15:13:26 +0800 Subject: [PATCH 40/42] Rename --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1b61802d85..c30a6d6a42 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -57,7 +57,7 @@ jobs: - name: Setup dependencies for user run: ./make.sh ci-setup-user-deps - - name: Rust build cache + - name: Rust lint cache uses: Swatinem/rust-cache@v2 with: workspaces: lib -> ../build/lib/target From 36aca416b470f93b958fc54d0b0a44108fb278b7 Mon Sep 17 00:00:00 2001 From: Niven Date: Thu, 30 Nov 2023 11:27:53 +0800 Subject: [PATCH 41/42] Rename to docker build from binaries --- .github/workflows/build-dev.yaml | 2 +- .github/workflows/build-release.yaml | 2 +- .github/workflows/build-staging.yaml | 2 +- make.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 96d0c1adc4..47cffc5de1 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -115,7 +115,7 @@ jobs: run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} -C ./build/ - name: Build defi image - run: rm .dockerignore && ./make.sh docker-defi-build + run: rm .dockerignore && ./make.sh docker-build-from-binaries - name: Login to Docker Hub uses: docker/login-action@v2 diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 439003c085..dfd6a05953 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -94,7 +94,7 @@ jobs: run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} -C ./build/ - name: Build defi image - run: rm .dockerignore && ./make.sh docker-defi-build + run: rm .dockerignore && ./make.sh docker-build-from-binaries - name: Login to Docker Hub uses: docker/login-action@v2 diff --git a/.github/workflows/build-staging.yaml b/.github/workflows/build-staging.yaml index 721e591f7c..9c369a207f 100644 --- a/.github/workflows/build-staging.yaml +++ b/.github/workflows/build-staging.yaml @@ -66,4 +66,4 @@ jobs: run: tar -xvzf ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} -C ./build/ - name: Build defi image - run: rm .dockerignore && ./make.sh docker-defi-build + run: rm .dockerignore && ./make.sh docker-build-from-binaries diff --git a/make.sh b/make.sh index 87b6e86331..22c22d462d 100755 --- a/make.sh +++ b/make.sh @@ -321,7 +321,7 @@ docker_release() { _sign "$target" } -docker_defi_build() { +docker_build_from_binaries() { local target=${1:-${TARGET}} local img_prefix="${IMAGE_PREFIX}" local img_version="${IMAGE_VERSION}" @@ -330,7 +330,7 @@ docker_defi_build() { local docker_context="${DOCKER_ROOT_CONTEXT}" local docker_file="${DEFI_DOCKERFILE}" - echo "> docker-defi-build"; + echo "> docker-build-from-binaries"; local img="${img_prefix}-${target}:${img_version}" echo "> building: ${img}" From c6b14456b5915452bbcad08660a59c5cc21406ad Mon Sep 17 00:00:00 2001 From: Niven Date: Thu, 30 Nov 2023 12:03:13 +0800 Subject: [PATCH 42/42] Better rename --- .github/workflows/build-dev.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml index 47cffc5de1..a71e2e45ee 100644 --- a/.github/workflows/build-dev.yaml +++ b/.github/workflows/build-dev.yaml @@ -74,7 +74,7 @@ jobs: name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }} path: ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }} - - name: Delete previous cpp cache + - name: Delete previous cpp build cache if: ${{ github.ref == 'refs/heads/master' && steps.cpp-cache-restore.outputs.cache-hit }} continue-on-error: true run: | @@ -83,7 +83,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Save cpp cache + - name: Save cpp build cache if: ${{ github.ref == 'refs/heads/master' }} uses: actions/cache/save@v3 with: