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