-
Notifications
You must be signed in to change notification settings - Fork 69
105 lines (84 loc) · 4.13 KB
/
non_vendored.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: 'non_vendored'
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
workflow_dispatch:
jobs:
# Linux build and test
linux-install:
name: "Linux | Install | ${{ matrix.compiler }} | ${{ matrix.config }}"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
compiler:
- gcc
config:
- release
env:
artifact-name: sl-${{ github.run_number }}-linux-${{ matrix.compiler }}-${{ matrix.config }}
steps:
- name: Checkout code
uses: actions/checkout@v3
# Fetch tags for CMakeLists version check
# https://github.com/actions/checkout/issues/701
- name: Git fetch tags
run: git fetch --tags origin
- uses: ./.github/linux-setup
with:
compiler: ${{ matrix.compiler }}
ccache-key: linux-install-${{ matrix.compiler }}-${{ matrix.config }}
- name: Install vendored dependencies
run: |
git clone --depth 1 https://github.com/google/googletest.git
pushd googletest
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON . && cmake --build build && sudo cmake --install build
popd
git clone --depth 1 --branch v1.0.0 https://github.com/capnproto/capnproto.git
pushd capnproto
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON . && cmake --build build && sudo cmake --install build
popd
git clone --depth 1 --branch v3.11.2 https://github.com/nlohmann/json.git
pushd json
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DJSON_BuildTests=OFF . && cmake --build build && sudo cmake --install build
popd
git clone --depth 1 --branch v1.84 https://github.com/chipsalliance/UHDM.git
pushd UHDM
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DUHDM_USE_HOST_GTEST=ON -DUHDM_USE_HOST_CAPNP=ON . && cmake --build build && sudo cmake --install build
popd
sudo mkdir -p /usr/share/java
sudo wget https://www.antlr.org/download/antlr-4.12.0-complete.jar -P /usr/share/java
wget https://www.antlr.org/download/antlr4-cpp-runtime-4.12.0-source.zip && mkdir antlr4
pushd antlr4
unzip ../antlr4-cpp-runtime-4.12.0-source.zip && cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON . && cmake --build build && sudo cmake --install build
popd
- name: Build, install & test
run: |
if [ "${{ matrix.config }}" == "debug" ]; then
export BUILD_TYPE=Debug
export CMAKE_ADDITIONAL_ARGS=-DSURELOG_WITH_TCMALLOC=Off
else
export BUILD_TYPE=Release
export CMAKE_ADDITIONAL_ARGS=
fi
export INSTALL_DIR=`pwd`/install
# Ensure that vendored dependencies' shared libraries are available
# for any run checks, such as those in the `TestInstall` project
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DBUILD_SHARED_LIBS=ON -DSURELOG_USE_HOST_ALL=ON -DSURELOG_WITH_TCMALLOC=OFF -DCMAKE_MODULE_PATH="/usr/share/CMake/Modules;/usr/local/lib/cmake" -S . -B build
cmake --build build -j $(nproc)
cmake --install build
cmake --build build --target UnitTests -j $(nproc)
pushd build && ctest --output-on-failure && popd
rm -rf build # make sure we only see installation artifacts
# this shouldnt be necessary, and can't be reproduced outside CI
export CMAKE_PREFIX_PATH=$INSTALL_DIR
cmake -DCMAKE_BUILD_TYPE=Release -DINSTALL_DIR=$INSTALL_DIR -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DBUILD_SHARED_LIBS=ON -DSURELOG_USE_HOST=ON -S tests/TestInstall -B tests/TestInstall/build
cmake --build tests/TestInstall/build -j $(nproc)
echo "-- pkg-config content --"
cat $INSTALL_DIR/lib/pkgconfig/Surelog.pc
PREFIX=$INSTALL_DIR make test_install_pkgconfig