mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
* Put conan-non-prod artifactory first * Rebuild all conan packages if no cache * Save cache only if there was no cache found
155 lines
4.4 KiB
YAML
155 lines
4.4 KiB
YAML
name: Build Clio
|
|
on:
|
|
push:
|
|
branches: [master, release/*, develop]
|
|
pull_request:
|
|
branches: [master, release/*, develop]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Run clang-format
|
|
uses: ./.github/actions/clang_format
|
|
|
|
build_mac:
|
|
name: Build macOS
|
|
needs: lint
|
|
runs-on: [self-hosted, macOS]
|
|
env:
|
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
|
CONAN_USER_HOME: ${{ github.workspace }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install packages
|
|
run: |
|
|
brew install llvm@14 pkg-config ninja bison cmake ccache jq
|
|
|
|
- name: Setup conan
|
|
uses: ./.github/actions/setup_conan
|
|
id: conan
|
|
|
|
- name: Restore cache
|
|
uses: ./.github/actions/restore_cache
|
|
id: restore_cache
|
|
with:
|
|
conan_dir: ${{ env.CONAN_USER_HOME }}/.conan
|
|
ccache_dir: ${{ env.CCACHE_DIR }}
|
|
|
|
- name: Build Clio
|
|
uses: ./.github/actions/build_clio
|
|
with:
|
|
conan_profile: ${{ steps.conan.outputs.conan_profile }}
|
|
conan_cache_hit: ${{ steps.restore_cache.outputs.conan_cache_hit }}
|
|
|
|
- name: Strip tests
|
|
run: strip build/clio_tests
|
|
|
|
- name: Upload clio_tests
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: clio_tests_mac
|
|
path: build/clio_tests
|
|
|
|
- name: Save cache
|
|
uses: ./.github/actions/save_cache
|
|
with:
|
|
conan_dir: ${{ env.CONAN_USER_HOME }}/.conan
|
|
conan_hash: ${{ steps.restore_cache.outputs.conan_hash }}
|
|
conan_cache_hit: ${{ steps.restore_cache.outputs.conan_cache_hit }}
|
|
ccache_dir: ${{ env.CCACHE_DIR }}
|
|
ccache_cache_hit: ${{ steps.restore_cache.outputs.ccache_cache_hit }}
|
|
|
|
build_linux:
|
|
name: Build linux
|
|
needs: lint
|
|
runs-on: [self-hosted, Linux]
|
|
container:
|
|
image: conanio/gcc11:1.61.0
|
|
options: --user root
|
|
env:
|
|
CCACHE_DIR: /root/.ccache
|
|
CONAN_USER_HOME: /root/
|
|
steps:
|
|
- name: Get Clio
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install packages
|
|
run: |
|
|
apt update -qq
|
|
apt install -y jq
|
|
|
|
- name: Install ccache
|
|
run: |
|
|
wget https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-linux-x86_64.tar.xz
|
|
tar xf ./ccache-4.8.3-linux-x86_64.tar.xz
|
|
mv ./ccache-4.8.3-linux-x86_64/ccache /usr/bin/ccache
|
|
|
|
- name: Fix git permissions
|
|
run: git config --global --add safe.directory $PWD
|
|
|
|
- name: Setup conan
|
|
uses: ./.github/actions/setup_conan
|
|
|
|
- name: Restore cache
|
|
uses: ./.github/actions/restore_cache
|
|
id: restore_cache
|
|
with:
|
|
conan_dir: ${{ env.CONAN_USER_HOME }}/.conan
|
|
ccache_dir: ${{ env.CCACHE_DIR }}
|
|
|
|
- name: Build Clio
|
|
uses: ./.github/actions/build_clio
|
|
with:
|
|
conan_cache_hit: ${{ steps.restore_cache.outputs.conan_cache_hit }}
|
|
|
|
- name: Strip tests
|
|
run: strip build/clio_tests
|
|
|
|
- name: Upload clio_tests
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: clio_tests_linux
|
|
path: build/clio_tests
|
|
|
|
- name: Save cache
|
|
uses: ./.github/actions/save_cache
|
|
with:
|
|
conan_dir: ${{ env.CONAN_USER_HOME }}/.conan
|
|
conan_hash: ${{ steps.restore_cache.outputs.conan_hash }}
|
|
conan_cache_hit: ${{ steps.restore_cache.outputs.conan_cache_hit }}
|
|
ccache_dir: ${{ env.CCACHE_DIR }}
|
|
ccache_cache_hit: ${{ steps.restore_cache.outputs.ccache_cache_hit }}
|
|
|
|
test_mac:
|
|
needs: build_mac
|
|
runs-on: [self-hosted, macOS]
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: clio_tests_mac
|
|
- name: Run clio_tests
|
|
run: |
|
|
chmod +x ./clio_tests
|
|
./clio_tests --gtest_filter="-BackendCassandraBaseTest*:BackendCassandraTest*:BackendCassandraFactoryTestWithDB*"
|
|
|
|
test_linux:
|
|
needs: build_linux
|
|
runs-on: [self-hosted, x-heavy]
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: clio_tests_linux
|
|
- name: Run clio_tests
|
|
run: |
|
|
chmod +x ./clio_tests
|
|
./clio_tests --gtest_filter="-BackendCassandraBaseTest*:BackendCassandraTest*:BackendCassandraFactoryTestWithDB*"
|