@@ -3,94 +3,112 @@ on: [push, pull_request]
33
44jobs :
55
6- test :
6+ dependencies :
77 strategy :
88 fail-fast : false
99 matrix :
1010 platform :
11- - ubuntu-latest
12- - macos-12
13- generator :
14- - Ninja
11+ - linux
12+ compiler :
13+ - gcc
14+ - clang
1515 configuration :
16+ - Debug
1617 - Release
17- runs-on : ${{ matrix.platform }}
18- env :
19- build_dir : .build
18+ include :
19+ - compiler : gcc
20+ profile :
21+ version : 11
22+ cc : /usr/bin/gcc
23+ cxx : /usr/bin/g++
24+ - compiler : clang
25+ profile :
26+ version : 14
27+ cc : /usr/bin/clang-14
28+ cxx : /usr/bin/clang++-14
29+ runs-on : [self-hosted, heavy]
30+ container : thejohnfreeman/rippled-build-ubuntu:12e19cd9034b
2031 steps :
21- - name : checkout
22- uses : actions/checkout@v3
23- - name : install Ninja on Linux
24- if : matrix.generator == 'Ninja' && runner.os == 'Linux'
25- run : sudo apt install ninja-build
26- - name : install Ninja on OSX
27- if : matrix.generator == 'Ninja' && runner.os == 'macOS'
28- run : brew install ninja
29- - name : install nproc on OSX
30- if : runner.os == 'macOS'
31- run : brew install coreutils
32- - name : choose Python
33- uses : actions/setup-python@v3
34- with :
35- python-version : 3.9
36- - name : learn Python cache directory
37- id : pip-cache
38- run : |
39- sudo pip install --upgrade pip
40- echo "::set-output name=dir::$(pip cache dir)"
41- - name : restore Python cache directory
42- uses : actions/cache@v2
43- with :
44- path : ${{ steps.pip-cache.outputs.dir }}
45- key : ${{ runner.os }}-${{ hashFiles('.github/workflows/nix.yml') }}
46- - name : install Conan
47- run : pip install wheel 'conan~=1.52'
4832 - name : check environment
4933 run : |
5034 echo ${PATH} | tr ':' '\n'
51- python --version
5235 conan --version
5336 cmake --version
5437 env
5538 - name : configure Conan
5639 run : |
5740 conan profile new default --detect
5841 conan profile update settings.compiler.cppstd=20 default
59- - name : configure Conan on Linux
60- if : runner.os == 'Linux'
61- run : |
42+ conan profile update settings.compiler=${{ matrix.compiler }} default
43+ conan profile update settings.compiler.version=${{ matrix.profile.version }} default
6244 conan profile update settings.compiler.libcxx=libstdc++11 default
63- - name : learn Conan cache directory
64- id : conan-cache
45+ conan profile update env.CC=${{ matrix.profile.cc }} default
46+ conan profile update env.CXX=${{ matrix.profile.cxx }} default
47+ conan profile update conf.tools.build:compiler_executables='{"c": "${{ matrix.profile.cc }}", "cpp": "${{ matrix.profile.cxx }}"}' default
48+ - name : checkout
49+ uses : actions/checkout@v3
50+ - name : build dependencies
6551 run : |
66- echo "::set-output name=dir::$(conan config get storage.path)"
67- - name : restore Conan cache directory
68- uses : actions/cache@v2
52+ mkdir .build
53+ cd .build
54+ conan install \
55+ --output-folder . \
56+ --build missing \
57+ --settings build_type=${{ matrix.configuration }} \
58+ ..
59+ - name : archive cache
60+ run : tar -czf conan.tar -C ~/.conan .
61+ - name : upload cache
62+ uses : actions/upload-artifact@v3
6963 with :
70- path : ${{ steps.conan-cache.outputs.dir }}
71- key : ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/nix.yml') }}
72- - name : export Snappy
73- run : conan export external/snappy snappy/1.1.9@
74- - name : install dependencies
64+ name : ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
65+ path : conan.tar
66+
67+
68+ test :
69+ strategy :
70+ fail-fast : false
71+ matrix :
72+ platform :
73+ - linux
74+ compiler :
75+ - gcc
76+ - clang
77+ configuration :
78+ - Debug
79+ - Release
80+ cmake-args :
81+ -
82+ - " -Dunity=ON"
83+ needs : dependencies
84+ runs-on : [self-hosted, heavy]
85+ container : thejohnfreeman/rippled-build-ubuntu:12e19cd9034b
86+ env :
87+ build_dir : .build
88+ steps :
89+ - name : download cache
90+ uses : actions/download-artifact@v3
91+ with :
92+ name : ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
93+ - name : extract cache
7594 run : |
76- mkdir ${build_dir}
77- cd ${build_dir}
78- conan install .. --build missing --settings build_type=${{ matrix.configuration }}
79- - name : configure
95+ mkdir -p ~/.conan
96+ tar -xzf conan.tar -C ~/.conan
97+ - name : check environment
8098 run : |
81- cd ${build_dir}
82- cmake \
83- -G ${{ matrix.generator }} \
84- -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
85- -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} \
86- -Dassert=ON \
87- -Dcoverage=OFF \
88- -Dreporting=OFF \
89- -Dunity=OFF \
90- ..
99+ echo ${PATH} | tr ':' '\n'
100+ conan --version
101+ cmake --version
102+ env
103+ ls ~/.conan
104+ - name : checkout
105+ uses : actions/checkout@v3
91106 - name : build
92- run : |
93- cmake --build ${build_dir} --target rippled --parallel $(nproc)
107+ uses : ./.github/actions/build
108+ with :
109+ generator : Ninja
110+ configuration : ${{ matrix.configuration }}
111+ cmake-args : ${{ matrix.cmake-args }}
94112 - name : test
95113 run : |
96114 ${build_dir}/rippled --unittest --unittest-jobs $(nproc)
0 commit comments