diff --git a/.github/workflows/build-special.yml b/.github/workflows/build-special.yml new file mode 100644 index 000000000..e5fc87fe3 --- /dev/null +++ b/.github/workflows/build-special.yml @@ -0,0 +1,153 @@ +name: Special Cases CI + +on: [pull_request] + +jobs: + build: + name: ${{ matrix.name }} ${{ matrix.build_type }} + runs-on: ${{ matrix.os }} + + env: + CTEST_OUTPUT_ON_FAILURE: ON + CTEST_PARALLEL_LEVEL: 2 + CMAKE_BUILD_TYPE: ${{ matrix.build_type }} + GTSAM_BUILD_UNSTABLE: ON + + strategy: + fail-fast: false + + matrix: + # Github Actions requires a single row to be added to the build matrix. + # See https://help.github.com/en/articles/workflow-syntax-for-github-actions. + name: [ + ubuntu-gcc-deprecated, + ubuntu-gcc-quaternions, + ubuntu-gcc-points-vector, + macos-xcode-deprecated, + macos-xcode-quaternions, + macos-xcode-points-vector, + ubuntu-clang-deprecated, + ubuntu-clang-quaternions, + ubuntu-clang-points-vector + ] + + build_type: [Debug, Release] + + include: + - name: ubuntu-gcc-deprecated + os: ubuntu-18.04 + compiler: gcc + version: "9" + flag: deprecated + + - name: ubuntu-gcc-quaternions + os: ubuntu-18.04 + compiler: gcc + version: "9" + flag: quaternions + + - name: ubuntu-gcc-points-vector + os: ubuntu-18.04 + compiler: gcc + version: "9" + flag: points-vector + + - name: macos-xcode-deprecated + os: macOS-10.15 + compiler: xcode + version: "11.3.1" + flag: deprecated + + - name: macos-xcode-quaternions + os: macOS-10.15 + compiler: xcode + version: "11.3.1" + flag: quaternions + + - name: macos-xcode-points-vector + os: macOS-10.15 + compiler: xcode + version: "11.3.1" + flag: points-vector + + - name: ubuntu-clang-deprecated + os: ubuntu-18.04 + compiler: clang + version: "9" + flag: deprecated + + - name: ubuntu-clang-quaternions + os: ubuntu-18.04 + compiler: clang + version: "9" + flag: quaternions + + - name: ubuntu-clang-points-vector + os: ubuntu-18.04 + compiler: clang + version: "9" + flag: points-vector + + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Install (Linux) + if: runner.os == 'Linux' + run: | + # LLVM 9 is not in Bionic's repositories so we add the official LLVM repository. + if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.version }}" = "9" ]; then + sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main" + fi + sudo apt-get -y update + + sudo apt install cmake build-essential pkg-config libpython-dev python-numpy + + echo "::set-env name=BOOST_ROOT::$(echo $BOOST_ROOT_1_69_0)" + echo "::set-env name=LD_LIBRARY_PATH::$(echo $BOOST_ROOT_1_69_0/lib)" + + if [ "${{ matrix.compiler }}" = "gcc" ]; then + sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib + echo "::set-env name=CC::gcc-${{ matrix.version }}" + echo "::set-env name=CXX::g++-${{ matrix.version }}" + else + sudo apt-get install -y clang-${{ matrix.version }} g++-multilib + echo "::set-env name=CC::clang-${{ matrix.version }}" + echo "::set-env name=CXX::clang++-${{ matrix.version }}" + fi + + - name: Install (macOS) + if: runner.os == 'macOS' + run: | + brew install cmake ninja boost + if [ "${{ matrix.compiler }}" = "gcc" ]; then + brew install gcc@${{ matrix.version }} + echo "::set-env name=CC::gcc-${{ matrix.version }}" + echo "::set-env name=CXX::g++-${{ matrix.version }}" + else + sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app + echo "::set-env name=CC::clang" + echo "::set-env name=CXX::clang++" + fi + + - name: Set Allow Deprecated Flag + if: matrix.flag == 'deprecated' + env: + GTSAM_ALLOW_DEPRECATED_SINCE_V41: ON + run: echo "Allow deprecated since version 4.1" + + - name: Set Use Quaternions Flag + if: matrix.flag == 'quaternions' + env: + GTSAM_USE_QUATERNIONS: ON + run: echo "Use Quaternions for rotations" + + - name: Set Typedef Points to Vector Flag + if: matrix.flag == 'points-vector' + env: + GTSAM_TYPEDEF_POINTS_TO_VECTOR: ON + run: echo "Typedef Points to Vector" + + - name: Build & Test + run: | + bash .github/scripts/unix.sh -t