-
Notifications
You must be signed in to change notification settings - Fork 211
112 lines (108 loc) · 3.87 KB
/
build.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
106
107
108
109
110
111
112
name: Build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
buildType: [RelWithDebInfo]
include:
- os: windows-latest
cmake_extra: '-A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
cmake_generator: '-G "Visual Studio 16 2019"'
- os: macOS-latest
pkg_config_path: '/usr/local/opt/[email protected]/lib/pkgconfig'
cmake_extra: '-DBUILD_RUBY=no -DTHREADERCISER=ON'
ctest_extra: '--exclude-regex c-threaderciser'
env:
BuildType: ${{matrix.buildType}}
BuildDir: ${{github.workspace}}/BLD
InstallPrefix: ${{github.workspace}}/INSTALL
PKG_CONFIG_PATH: ${{matrix.pkg_config_path}}
VCPKG_DEFAULT_TRIPLET: x64-windows
steps:
- uses: actions/checkout@v3
- name: Create Build and Install directories
run: mkdir -p "${BuildDir}" "${InstallPrefix}"
shell: bash
# PROTON-2295 avoid using go 1.15.3 on macOS, which is broken
- if: runner.os == 'macOS'
name: Setup go (Mac OS)
uses: actions/setup-go@v3
with:
go-version: '^1.15.4'
# PROTON-2644 upgrading setup-python to v4 breaks cmake discovery of openssl on macOS
- name: Setup python
uses: actions/setup-python@v3
with:
python-version: 3.9
architecture: x64
cache: 'pip'
- name: Install python dependencies
run: |
python -m pip install --upgrade -r python/requirements.txt
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev
- name: Install Windows dependencies
if: runner.os == 'Windows'
run: |
choco install -y swig --version=4.0.1
vcpkg install jsoncpp
vcpkg integrate install
- name: Install MacOS dependencies
if: runner.os == 'macOS'
run: |
brew install libuv swig pkgconfig jsoncpp
- name: OTel build/install
if: runner.os == 'Linux'
working-directory: ${{github.workspace}}
run: sudo sh ./ci/otel.sh
shell: bash
- name: cmake configure
working-directory: ${{env.BuildDir}}
run: cmake "${{github.workspace}}" "-DCMAKE_BUILD_TYPE=${BuildType}" "-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" ${{matrix.cmake_extra}}
shell: bash
- name: cmake build/install
run: cmake --build "${BuildDir}" --config ${BuildType} -t install
shell: bash
- name: Upload Install
uses: actions/upload-artifact@v3
with:
name: qpid_proton_pkg_${{matrix.os}}_${{matrix.buildType}}
path: ${{env.InstallPrefix}}
- name: Upload python packages
uses: actions/upload-artifact@v3
with:
name: python-pkgs
path: ${{env.BuildDir}}/python/dist
- id: ctest
name: ctest
working-directory: ${{env.BuildDir}}
run: ctest -C ${BuildType} -V -T Test --no-compress-output ${{matrix.ctest_extra}}
shell: bash
- name: Upload Test results
if: always() && (steps.ctest.outcome == 'failure' || steps.ctest.outcome == 'success')
uses: actions/upload-artifact@v3
with:
name: Test_Results_${{matrix.os}}_${{matrix.buildType}}
path: ${{env.BuildDir}}/Testing/**/*.xml
- name: Upload Python & C build directories on failure
uses: actions/upload-artifact@v3
if: failure()
with:
name: Debug-python-C-BLD_${{matrix.os}}_${{matrix.buildType}}
path: |
${{env.BuildDir}}/c
${{env.BuildDir}}/python
- name: Environment (Linux/Windows)
if: always() && runner.os != 'macOS'
run: env -0 | sort -z | tr '\0' '\n'
shell: bash
- name: Environment (macOS)
if: always() && runner.os == 'macOS'
run: env | sort
shell: bash