Add caching and dependency installation steps for ARM, Intel, and mac… (#25)
This commit is contained in:
parent
e4ff164f0d
commit
11d19e5446
8 changed files with 33 additions and 36 deletions
4
.github/actions/upload-artifacts/action.yml
vendored
4
.github/actions/upload-artifacts/action.yml
vendored
|
|
@ -38,7 +38,7 @@ runs:
|
||||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
||||||
TAG_SUFFIX="-${{ github.event.number }}alpha"
|
TAG_SUFFIX="-alpha.${{ github.event.number }}"
|
||||||
PRERELEASE=true
|
PRERELEASE=true
|
||||||
elif [ "${{ inputs.chain-network }}" != "mainnet" ]; then
|
elif [ "${{ inputs.chain-network }}" != "mainnet" ]; then
|
||||||
TAG_SUFFIX="-beta"
|
TAG_SUFFIX="-beta"
|
||||||
|
|
@ -86,5 +86,5 @@ runs:
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.asset.outputs.tag_name }}
|
tag_name: ${{ steps.asset.outputs.tag_name }}
|
||||||
prerelease: ${{ steps.asset.outputs.prerelease }}
|
prerelease: ${{ steps.asset.outputs.prerelease }}
|
||||||
files: ${{ inputs.asset-directory }}/lethean-*
|
files: ${{ inputs.asset-directory }}/*
|
||||||
target_commitish: ${{ github.sha }}
|
target_commitish: ${{ github.sha }}
|
||||||
|
|
|
||||||
23
.github/workflows/_on-pr.yml
vendored
23
.github/workflows/_on-pr.yml
vendored
|
|
@ -10,35 +10,12 @@ on:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- closed
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cleanup-release:
|
|
||||||
name: Cleanup Release
|
|
||||||
if: github.event.action == 'closed' && github.event.pull_request.merged == true
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Project
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
|
|
||||||
- name: Get Version
|
|
||||||
id: get_version
|
|
||||||
run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Delete Release and Tag
|
|
||||||
if: contains(steps.get_version.outputs.VERSION, '-alpha') || contains(steps.get_version.outputs.VERSION, '-beta')
|
|
||||||
uses: dev-drprasad/delete-older-releases@v0.3.4
|
|
||||||
with:
|
|
||||||
keep_latest: 0
|
|
||||||
delete_tags: true
|
|
||||||
delete_tag_pattern: ${{ steps.get_version.outputs.VERSION }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
build-linux-intel:
|
build-linux-intel:
|
||||||
name: Linux
|
name: Linux
|
||||||
if: ${{!github.event.pull_request.draft}}
|
if: ${{!github.event.pull_request.draft}}
|
||||||
|
|
|
||||||
5
.github/workflows/build-linux-arm64.yml
vendored
5
.github/workflows/build-linux-arm64.yml
vendored
|
|
@ -45,7 +45,10 @@ jobs:
|
||||||
|
|
||||||
- name: Compile Dependencies
|
- name: Compile Dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
|
run: |
|
||||||
|
make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
|
||||||
|
make upload-conan-cache
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: compile-arm64
|
name: compile-arm64
|
||||||
|
|
|
||||||
5
.github/workflows/build-linux-intel.yml
vendored
5
.github/workflows/build-linux-intel.yml
vendored
|
|
@ -45,7 +45,10 @@ jobs:
|
||||||
|
|
||||||
- name: Compile Dependencies
|
- name: Compile Dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
|
run: |
|
||||||
|
make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
|
||||||
|
make upload-conan-cache
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|
|
||||||
5
.github/workflows/build-macos-arm64.yml
vendored
5
.github/workflows/build-macos-arm64.yml
vendored
|
|
@ -43,7 +43,10 @@ jobs:
|
||||||
|
|
||||||
- name: Compile Dependencies
|
- name: Compile Dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: make build-deps CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
|
run: |
|
||||||
|
make build-deps CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
|
||||||
|
make upload-conan-cache
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: compile-armv8
|
name: compile-armv8
|
||||||
|
|
|
||||||
4
.github/workflows/build-macos-intel.yml
vendored
4
.github/workflows/build-macos-intel.yml
vendored
|
|
@ -41,7 +41,9 @@ jobs:
|
||||||
|
|
||||||
- name: Compile Dependencies
|
- name: Compile Dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
|
run: |
|
||||||
|
make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
|
||||||
|
make upload-conan-cache
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: compile-x86_64
|
name: compile-x86_64
|
||||||
|
|
|
||||||
4
.github/workflows/build-windows-intel.yml
vendored
4
.github/workflows/build-windows-intel.yml
vendored
|
|
@ -41,7 +41,9 @@ jobs:
|
||||||
|
|
||||||
- name: Compile Dependencies
|
- name: Compile Dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
|
run: |
|
||||||
|
make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
|
||||||
|
make upload-conan-cache
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: compile-x86_64
|
name: compile-x86_64
|
||||||
|
|
|
||||||
19
Makefile
19
Makefile
|
|
@ -63,6 +63,9 @@ CONAN_CPU_COUNT=$(CPU_CORES)
|
||||||
PROFILES := $(patsubst cmake/profiles/%,%,$(wildcard cmake/profiles/*))
|
PROFILES := $(patsubst cmake/profiles/%,%,$(wildcard cmake/profiles/*))
|
||||||
SORTED_PROFILES := $(sort $(PROFILES))
|
SORTED_PROFILES := $(sort $(PROFILES))
|
||||||
CONAN_CACHE := $(CURDIR)/build/sdk
|
CONAN_CACHE := $(CURDIR)/build/sdk
|
||||||
|
CONAN_URL:=https://artifacts.host.uk.com/artifactory/api/conan/conan-build
|
||||||
|
CONAN_USER:=public
|
||||||
|
CONAN_PASSWORD:=Lethean1234
|
||||||
DEFAULT_CONAN_PROFILE := $(CONAN_CACHE)/profiles/default
|
DEFAULT_CONAN_PROFILE := $(CONAN_CACHE)/profiles/default
|
||||||
CONAN_EXECUTABLE := $(CURDIR)/build/bin/conan
|
CONAN_EXECUTABLE := $(CURDIR)/build/bin/conan
|
||||||
CC_DOCKER_FILE?=utils/docker/images/lthn-chain/Dockerfile
|
CC_DOCKER_FILE?=utils/docker/images/lthn-chain/Dockerfile
|
||||||
|
|
@ -91,8 +94,17 @@ configure: build-deps
|
||||||
@echo "Running Configure: $(BUILD_TYPE) testnet=$(TESTNET)"
|
@echo "Running Configure: $(BUILD_TYPE) testnet=$(TESTNET)"
|
||||||
cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
|
cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
|
||||||
|
|
||||||
|
docs: configure
|
||||||
|
@echo "Building Documentation"
|
||||||
|
cmake --build build/release --target=docs --config=Release --parallel=$(CPU_CORES)
|
||||||
|
|
||||||
get-conan:
|
get-conan:
|
||||||
cmake -P cmake/GetConan.cmake
|
cmake -P cmake/GetConan.cmake
|
||||||
|
(CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) remote add conan_build $(CONAN_URL) && \
|
||||||
|
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) remote login conan_build $(CONAN_USER) -p $(CONAN_PASSWORD)) || true
|
||||||
|
|
||||||
|
upload-conan-cache:
|
||||||
|
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) upload "*" -r=conan_build --confirm
|
||||||
|
|
||||||
conan-profile-detect: get-conan
|
conan-profile-detect: get-conan
|
||||||
cmake -P cmake/ConanProfileSetup.cmake
|
cmake -P cmake/ConanProfileSetup.cmake
|
||||||
|
|
@ -139,11 +151,6 @@ test-debug:
|
||||||
cmake --build build/test-debug --config=Debug --parallel=$(CPU_CORES)
|
cmake --build build/test-debug --config=Debug --parallel=$(CPU_CORES)
|
||||||
$(MAKE) test
|
$(MAKE) test
|
||||||
|
|
||||||
|
|
||||||
docs: configure
|
|
||||||
@echo "Building Documentation"
|
|
||||||
cmake --build build/release --target=docs --config=Release --parallel=$(CPU_CORES)
|
|
||||||
|
|
||||||
docs-dev: configure
|
docs-dev: configure
|
||||||
@echo "Building Documentation"
|
@echo "Building Documentation"
|
||||||
cmake --build build/release --target=serve_docs --config=Release
|
cmake --build build/release --target=serve_docs --config=Release
|
||||||
|
|
@ -157,4 +164,4 @@ clean-build:
|
||||||
tags:
|
tags:
|
||||||
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest
|
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest
|
||||||
|
|
||||||
.PHONY: all release docker-chain-node debug docs docs-dev configure static static-release test test-release test-debug clean tags conan-profile-detect get-conan $(PROFILES)
|
.PHONY: all release upload-conan-cache docker-chain-node debug docs docs-dev configure static static-release test test-release test-debug clean tags conan-profile-detect get-conan $(PROFILES)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue