Merge pull request #839 from borglab/feature/ci-speedup
commit
41c82687ac
|
|
@ -9,10 +9,10 @@ tar -zxf ${BOOST_FOLDER}.tar.gz
|
||||||
|
|
||||||
# Bootstrap
|
# Bootstrap
|
||||||
cd ${BOOST_FOLDER}/
|
cd ${BOOST_FOLDER}/
|
||||||
./bootstrap.sh
|
./bootstrap.sh --with-libraries=serialization,filesystem,thread,system,atomic,date_time,timer,chrono,program_options,regex
|
||||||
|
|
||||||
# Build and install
|
# Build and install
|
||||||
sudo ./b2 install
|
sudo ./b2 -j$(nproc) install
|
||||||
|
|
||||||
# Rebuild ld cache
|
# Rebuild ld cache
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,11 @@ function build ()
|
||||||
|
|
||||||
configure
|
configure
|
||||||
|
|
||||||
make -j2
|
if [ "$(uname)" == "Linux" ]; then
|
||||||
|
make -j$(nproc)
|
||||||
|
elif [ "$(uname)" == "Darwin" ]; then
|
||||||
|
make -j$(sysctl -n hw.physicalcpu)
|
||||||
|
fi
|
||||||
|
|
||||||
finish
|
finish
|
||||||
}
|
}
|
||||||
|
|
@ -105,8 +109,12 @@ function test ()
|
||||||
|
|
||||||
configure
|
configure
|
||||||
|
|
||||||
# Actual build:
|
# Actual testing
|
||||||
make -j2 check
|
if [ "$(uname)" == "Linux" ]; then
|
||||||
|
make -j$(nproc)
|
||||||
|
elif [ "$(uname)" == "Darwin" ]; then
|
||||||
|
make -j$(sysctl -n hw.physicalcpu)
|
||||||
|
fi
|
||||||
|
|
||||||
finish
|
finish
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,7 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install (Linux)
|
- name: Install Dependencies
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
run: |
|
||||||
# LLVM (clang) 9 is not in Bionic's repositories so we add the official LLVM repository.
|
# LLVM (clang) 9 is not in Bionic's repositories so we add the official LLVM repository.
|
||||||
if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.version }}" = "9" ]; then
|
if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.version }}" = "9" ]; then
|
||||||
|
|
@ -63,7 +62,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
|
|
||||||
sudo apt-get install cmake build-essential pkg-config libpython-dev python-numpy libicu-dev
|
sudo apt-get -y install cmake build-essential pkg-config libpython-dev python-numpy libicu-dev
|
||||||
|
|
||||||
if [ "${{ matrix.compiler }}" = "gcc" ]; then
|
if [ "${{ matrix.compiler }}" = "gcc" ]; then
|
||||||
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
|
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
|
||||||
|
|
@ -79,7 +78,5 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
bash .github/scripts/boost.sh
|
bash .github/scripts/boost.sh
|
||||||
|
|
||||||
- name: Build and Test (Linux)
|
- name: Build and Test
|
||||||
if: runner.os == 'Linux'
|
run: bash .github/scripts/unix.sh -t
|
||||||
run: |
|
|
||||||
bash .github/scripts/unix.sh -t
|
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,7 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install (macOS)
|
- name: Install Dependencies
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: |
|
run: |
|
||||||
brew install cmake ninja
|
brew install cmake ninja
|
||||||
brew install boost
|
brew install boost
|
||||||
|
|
@ -48,7 +47,5 @@ jobs:
|
||||||
echo "CC=clang" >> $GITHUB_ENV
|
echo "CC=clang" >> $GITHUB_ENV
|
||||||
echo "CXX=clang++" >> $GITHUB_ENV
|
echo "CXX=clang++" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
- name: Build and Test (macOS)
|
- name: Build and Test
|
||||||
if: runner.os == 'macOS'
|
run: bash .github/scripts/unix.sh -t
|
||||||
run: |
|
|
||||||
bash .github/scripts/unix.sh -t
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
|
|
||||||
sudo apt install cmake build-essential pkg-config libpython-dev python-numpy libboost-all-dev
|
sudo apt-get -y install cmake build-essential pkg-config libpython-dev python-numpy libboost-all-dev
|
||||||
|
|
||||||
if [ "${{ matrix.compiler }}" = "gcc" ]; then
|
if [ "${{ matrix.compiler }}" = "gcc" ]; then
|
||||||
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
|
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
|
|
||||||
sudo apt install cmake build-essential pkg-config libpython-dev python-numpy libicu-dev
|
sudo apt-get -y install cmake build-essential pkg-config libpython-dev python-numpy libicu-dev
|
||||||
|
|
||||||
if [ "${{ matrix.compiler }}" = "gcc" ]; then
|
if [ "${{ matrix.compiler }}" = "gcc" ]; then
|
||||||
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
|
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,16 @@ jobs:
|
||||||
CTEST_PARALLEL_LEVEL: 2
|
CTEST_PARALLEL_LEVEL: 2
|
||||||
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
|
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
|
||||||
GTSAM_BUILD_UNSTABLE: ${{ matrix.build_unstable }}
|
GTSAM_BUILD_UNSTABLE: ${{ matrix.build_unstable }}
|
||||||
|
BOOST_VERSION: 1.72.0
|
||||||
|
BOOST_EXE: boost_1_72_0-msvc-14.2
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# Github Actions requires a single row to be added to the build 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.
|
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
|
||||||
name: [
|
name: [
|
||||||
#TODO This build keeps timing out, need to understand why.
|
#TODO This build fails, need to understand why.
|
||||||
# windows-2016-cl,
|
# windows-2016-cl,
|
||||||
windows-2019-cl,
|
windows-2019-cl,
|
||||||
]
|
]
|
||||||
|
|
@ -26,28 +29,29 @@ jobs:
|
||||||
build_type: [Debug, Release]
|
build_type: [Debug, Release]
|
||||||
build_unstable: [ON]
|
build_unstable: [ON]
|
||||||
include:
|
include:
|
||||||
|
#TODO This build fails, need to understand why.
|
||||||
#TODO This build keeps timing out, need to understand why.
|
|
||||||
# - name: windows-2016-cl
|
# - name: windows-2016-cl
|
||||||
# os: windows-2016
|
# os: windows-2016
|
||||||
# compiler: cl
|
# compiler: cl
|
||||||
|
# platform: 32
|
||||||
|
|
||||||
- name: windows-2019-cl
|
- name: windows-2019-cl
|
||||||
os: windows-2019
|
os: windows-2019
|
||||||
compiler: cl
|
compiler: cl
|
||||||
|
platform: 64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Install Dependencies
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Install (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
|
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
|
||||||
|
scoop install cmake --global # So we don't get issues with CMP0074 policy
|
||||||
scoop install ninja --global
|
scoop install ninja --global
|
||||||
|
|
||||||
if ("${{ matrix.compiler }}".StartsWith("clang")) {
|
if ("${{ matrix.compiler }}".StartsWith("clang")) {
|
||||||
scoop install llvm --global
|
scoop install llvm --global
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("${{ matrix.compiler }}" -eq "gcc") {
|
if ("${{ matrix.compiler }}" -eq "gcc") {
|
||||||
# Chocolatey GCC is broken on the windows-2019 image.
|
# Chocolatey GCC is broken on the windows-2019 image.
|
||||||
# See: https://github.com/DaanDeMeyer/doctest/runs/231595515
|
# See: https://github.com/DaanDeMeyer/doctest/runs/231595515
|
||||||
|
|
@ -55,27 +59,38 @@ jobs:
|
||||||
scoop install gcc --global
|
scoop install gcc --global
|
||||||
echo "CC=gcc" >> $GITHUB_ENV
|
echo "CC=gcc" >> $GITHUB_ENV
|
||||||
echo "CXX=g++" >> $GITHUB_ENV
|
echo "CXX=g++" >> $GITHUB_ENV
|
||||||
|
|
||||||
} elseif ("${{ matrix.compiler }}" -eq "clang") {
|
} elseif ("${{ matrix.compiler }}" -eq "clang") {
|
||||||
echo "CC=clang" >> $GITHUB_ENV
|
echo "CC=clang" >> $GITHUB_ENV
|
||||||
echo "CXX=clang++" >> $GITHUB_ENV
|
echo "CXX=clang++" >> $GITHUB_ENV
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
echo "CC=${{ matrix.compiler }}" >> $GITHUB_ENV
|
echo "CC=${{ matrix.compiler }}" >> $env:GITHUB_ENV
|
||||||
echo "CXX=${{ matrix.compiler }}" >> $GITHUB_ENV
|
echo "CXX=${{ matrix.compiler }}" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scoop modifies the PATH so we make the modified PATH global.
|
# Scoop modifies the PATH so we make the modified PATH global.
|
||||||
echo "$env:PATH" >> $GITHUB_PATH
|
echo "$env:PATH" >> $env:GITHUB_PATH
|
||||||
|
|
||||||
- name: Download and install Boost
|
- name: Install Boost
|
||||||
uses: MarkusJx/install-boost@v1.0.1
|
shell: powershell
|
||||||
id: install-boost
|
run: |
|
||||||
with:
|
# Snippet from: https://github.com/actions/virtual-environments/issues/2667
|
||||||
boost_version: 1.72.0
|
$BOOST_PATH = "C:\hostedtoolcache\windows\Boost\$env:BOOST_VERSION\x86_64"
|
||||||
toolset: msvc14.2
|
|
||||||
|
|
||||||
- name: Build (Windows)
|
# Use the prebuilt binary for Windows
|
||||||
if: runner.os == 'Windows'
|
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/$env:BOOST_VERSION/$env:BOOST_EXE-${{matrix.platform}}.exe"
|
||||||
env:
|
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
|
||||||
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
|
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=$BOOST_PATH"
|
||||||
|
|
||||||
|
# Set the BOOST_ROOT variable
|
||||||
|
echo "BOOST_ROOT=$BOOST_PATH" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cmake -E remove_directory build
|
cmake -E remove_directory build
|
||||||
cmake -B build -S . -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DBOOST_ROOT="${env:BOOST_ROOT}" -DBOOST_INCLUDEDIR="${env:BOOST_ROOT}\boost\include" -DBOOST_LIBRARYDIR="${env:BOOST_ROOT}\lib"
|
cmake -B build -S . -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DBOOST_ROOT="${env:BOOST_ROOT}" -DBOOST_INCLUDEDIR="${env:BOOST_ROOT}\boost\include" -DBOOST_LIBRARYDIR="${env:BOOST_ROOT}\lib"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue