From ecfce8a06ac82ed2ca49542ff70a181d464509bf Mon Sep 17 00:00:00 2001 From: Kirill Azovtsev Date: Sun, 23 Jun 2024 23:30:22 +0300 Subject: [PATCH] new build kagome pipeline - activate cache --- .github/workflows/zombie-tests.yaml | 22 ++++++++++--------- housekeeping/docker/kagome-dev/Makefile | 8 +++++++ .../docker/kagome-dev/build_apt_package.sh | 0 3 files changed, 20 insertions(+), 10 deletions(-) mode change 100644 => 100755 housekeeping/docker/kagome-dev/build_apt_package.sh diff --git a/.github/workflows/zombie-tests.yaml b/.github/workflows/zombie-tests.yaml index 22ca66a4eb..1ad9abef26 100644 --- a/.github/workflows/zombie-tests.yaml +++ b/.github/workflows/zombie-tests.yaml @@ -15,23 +15,25 @@ env: KAGOME_IN_DOCKER: 1 CTEST_OUTPUT_ON_FAILURE: 1 -# CACHE_VERSION: v07 -# CACHE_PATHS: | -# ~/Library/Caches/pip -# ~/.cargo -# ~/.ccache -# ~/.hunter -# ~/.rustup + CACHE_VERSION: v01 + CACHE_PATH: ./build/cache jobs: - building_binaries: + kagome_dev_docker_build: runs-on: [ actions-runner-controller ] - timeout-minutes: 120 + timeout-minutes: 180 steps: - - name: Checkout repository + - name: "Checkout repository" uses: actions/checkout@v4 + - name: "Cache dependencies" + uses: actions/cache@v4 + with: + path: ${{ env.CACHE_PATH }} + key: ${{ github.job }}-${{ env.CACHE_VERSION }} + save-always: true + - name: "Authenticate with Google Cloud" uses: 'google-github-actions/auth@v2' with: diff --git a/housekeeping/docker/kagome-dev/Makefile b/housekeeping/docker/kagome-dev/Makefile index f92e2812cc..39f5bfe0cb 100644 --- a/housekeeping/docker/kagome-dev/Makefile +++ b/housekeeping/docker/kagome-dev/Makefile @@ -22,7 +22,10 @@ CTEST_OUTPUT_ON_FAILURE ?= 1 # Debug, Release, RelWithDebInfo BUILD_TYPE ?= Release + BUILD_DIR ?= build +CACHE_DIR := $(shell pwd)/../../../../kagome/$(BUILD_DIR)/cache +WORKING_DIR := $(shell pwd)/../../../../kagome export DOCKER_BUILDKIT=1 # BUILDKIT_PROGRESS - auto, plain, tty, rawjson @@ -46,6 +49,7 @@ kagome_builder_deb_push: docker push $(DOCKER_REGISTRY_PATH)kagome_builder_deb:latest kagome_dev_docker_build: + mkdir -p $(CACHE_DIR)/.cargo $(CACHE_DIR)/.hunter $(CACHE_DIR)/.cache/ccache $(CACHE_DIR)/.rustup ; \ CONTAINER_NAME=kagome_dev_build_$$(openssl rand -hex 6); \ SHORT_COMMIT_HASH=$$(grep 'short_commit_hash:' commit_hash.txt | cut -d ' ' -f 2); \ BUILD_THREADS=$$(nproc 2>/dev/null || sysctl -n hw.ncpu); \ @@ -64,6 +68,10 @@ kagome_dev_docker_build: -e CTEST_OUTPUT_ON_FAILURE=$(CTEST_OUTPUT_ON_FAILURE) \ -v $$(pwd)/../../../../kagome:/opt/kagome \ -v $(GOOGLE_APPLICATION_CREDENTIALS):/root/.gcp/google_creds.json \ + -v $(CACHE_DIR)/.cargo:/root/.cargo \ + -v $(CACHE_DIR)/.hunter:/root/.hunter \ + -v $(CACHE_DIR)/.cache/ccache:/root/.cache/ccache \ + -v $(CACHE_DIR)/.rustup:/root/.rustup \ $(DOCKER_REGISTRY_PATH)kagome_builder_deb:$(MINIDEB_TAG) \ -c "tail -f /dev/null"; \ docker exec -t $$CONTAINER_NAME /bin/bash -c \ diff --git a/housekeeping/docker/kagome-dev/build_apt_package.sh b/housekeeping/docker/kagome-dev/build_apt_package.sh old mode 100644 new mode 100755