Debian Codegraph @

.github/workflows/build.yml

raw
1 name: Build
2
3 on: [push, pull_request]
4
5 jobs:
6 build:
7 runs-on: ${{ matrix.os }}
8 strategy:
9 fail-fast: false
10 matrix:
11 os: [ubuntu-latest, windows-latest, macOS-latest]
12 buildType: [RelWithDebInfo]
13 include:
14 - os: windows-latest
15 cmake_extra: '-A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
16 cmake_generator: '-G "Visual Studio 16 2019"'
17 - os: macOS-latest
18 pkg_config_path: '/usr/local/opt/[email protected]/lib/pkgconfig'
19 cmake_extra: '-DBUILD_RUBY=no -DTHREADERCISER=ON'
20 ctest_extra: '--exclude-regex c-threaderciser'
21 env:
22 BuildType: ${{matrix.buildType}}
23 BuildDir: ${{github.workspace}}/BLD
24 InstallPrefix: ${{github.workspace}}/INSTALL
25 PKG_CONFIG_PATH: ${{matrix.pkg_config_path}}
26 VCPKG_DEFAULT_TRIPLET: x64-windows
27 steps:
28 - uses: actions/checkout@v2
29 - name: Create Build and Install directories
30 run: mkdir -p "${BuildDir}" "${InstallPrefix}"
31 shell: bash
32
33 # PROTON-2295 avoid using go 1.15.3 on macOS, which is broken
34 - if: runner.os == 'macOS'
35 name: Setup go (Mac OS)
36 uses: actions/setup-go@v2
37 with:
38 go-version: '^1.15.4'
39
40 - name: Setup python
41 uses: actions/setup-python@v2
42 with:
43 python-version: 3.6
44 architecture: x64
45 - name: Install python dependencies
46 run: |
47 python -m pip install --upgrade pip
48 python -m pip install setuptools wheel tox
49 - name: Install Linux dependencies
50 if: runner.os == 'Linux'
51 run: |
52 sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev
53 - name: Install Windows dependencies
54 if: runner.os == 'Windows'
55 run: |
56 choco install -y swig --version=4.0.1
57 vcpkg install jsoncpp
58 vcpkg integrate install
59 - name: Install MacOS dependencies
60 if: runner.os == 'macOS'
61 run: |
62 brew install libuv swig pkgconfig jsoncpp
63 - name: cmake configure
64 working-directory: ${{env.BuildDir}}
65 run: cmake "${{github.workspace}}" "-DCMAKE_BUILD_TYPE=${BuildType}" "-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" ${{matrix.cmake_extra}}
66 shell: bash
67 - name: cmake build/install
68 run: cmake --build "${BuildDir}" --config ${BuildType} -t install
69 shell: bash
70 - name: Upload Install
71 uses: actions/upload-artifact@v2
72 with:
73 name: qpid_proton_pkg_${{matrix.os}}_${{matrix.buildType}}
74 path: ${{env.InstallPrefix}}
75 - name: Upload python packages
76 uses: actions/upload-artifact@v2
77 with:
78 name: python-pkgs
79 path: ${{env.BuildDir}}/python/pkgs
80 - id: ctest
81 name: ctest
82 working-directory: ${{env.BuildDir}}
83 run: ctest -C ${BuildType} -V -T Test --no-compress-output ${{matrix.ctest_extra}}
84 shell: bash
85 - name: Upload Test results
86 if: always() && (steps.ctest.outcome == 'failure' || steps.ctest.outcome == 'success')
87 uses: actions/upload-artifact@v2
88 with:
89 name: Test_Results_${{matrix.os}}_${{matrix.buildType}}
90 path: ${{env.BuildDir}}/Testing/**/*.xml
91 - name: Upload Python & C build directories on failure
92 uses: actions/upload-artifact@v2
93 if: failure()
94 with:
95 name: Debug-python-C-BLD_${{matrix.os}}_${{matrix.buildType}}
96 path: |
97 ${{env.BuildDir}}/c
98 ${{env.BuildDir}}/python
99 - name: Environment (Linux/Windows)
100 if: always() && runner.os != 'macOS'
101 run: env -0 | sort -z | tr '\0' '\n'
102 shell: bash
103 - name: Environment (macOS)
104 if: always() && runner.os == 'macOS'
105 run: env | sort
106 shell: bash