Skip to content

Commit

Permalink
Update Catch2 to v3.1.1; Test on ubuntu jammy
Browse files Browse the repository at this point in the history
This version of Catch2 doesn't have the same issues that sometimes
causes v3.0.1 to fail to compile with older ubuntu versions/compiler
versions.

Moreover, it also can compile with newer compilers (like gcc-11) on
ubuntu jammy.

So, adding ubuntu jammy to the `test_editable_pip_install` and `ci`
github action workflows.

Fixes symforce-org#132
  • Loading branch information
bradley-solliday-skydio committed Oct 25, 2022
1 parent 7ca1e43 commit c7e9a55
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
python: [python3.8, python3.9, python3.10]
compiler: [
{C: gcc-5, CXX: g++-5, repos: [
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/test_editable_pip_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-22.04, ubuntu-20.04, macos-latest]
pip_version: [22.2.2]
setuptools_version: [65.3.0]
steps:
Expand All @@ -28,10 +28,18 @@ jobs:
python3 -m pip install pip==${{ matrix.pip_version }}
python3 -m pip install setuptools==${{ matrix.setuptools_version }}
# NOTE(brad): There seems to be a bug in pip which prevents editable installation
# in user directories. Seems to be resolved in 22.3.0. An alternative which works
# for older pip versions is to instead run `pip install --no-use-pep517 -e .` See
# https://github.com/pypa/pip/issues/7953 for more info.
- name: Update pip
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: python3 -m pip install pip==22.3.0

- name: editable install
run: python3 -m pip install -e .

- name: Set expected install locations for ubuntu
- name: Set expected install locations for ubuntu focal
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
echo CC_SYM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/cc_sym.cpython-38-x86_64-linux-gnu.so >> $GITHUB_ENV
Expand All @@ -42,6 +50,17 @@ jobs:
echo LCMTYPES_EIGENLCM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/eigen_lcm/__init__.py >> $GITHUB_ENV
echo SF_SYMPY_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV
- name: Set expected install locations for ubuntu jammy
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
echo CC_SYM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/cc_sym.cpython-310-x86_64-linux-gnu.so >> $GITHUB_ENV
echo SYM_LOCATION=/home/runner/.local/lib/python3.10/site-packages/sym/__init__.py >> $GITHUB_ENV
echo SKYMARSHAL_LOCATION=/home/runner/.local/lib/python3.10/site-packages/skymarshal/__init__.py >> $GITHUB_ENV
echo SYMENGINE_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV
echo LCMTYPES_SYM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/sym/__init__.py >> $GITHUB_ENV
echo LCMTYPES_EIGENLCM_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/lcmtypes_build/lcmtypes/eigen_lcm/__init__.py >> $GITHUB_ENV
echo SF_SYMPY_LOCATION=/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/third_party/symenginepy/symengine/__init__.py >> $GITHUB_ENV
- name: Set expected install locations for macos
if: ${{ matrix.os == 'macos-latest' }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ endif()
# catch2

if(SYMFORCE_BUILD_BENCHMARKS OR SYMFORCE_BUILD_TESTS)
find_package(Catch2 3.0.0 QUIET)
find_package(Catch2 3.1.1 QUIET)
if(NOT Catch2_FOUND)
message(STATUS "Catch2 not found, adding with FetchContent")
function(add_catch)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG b9853b4b356b83bb580c746c3a1f11101f9af54f # v3.0.0-preview3
GIT_TAG 5df88da16e276f853cc0c45f4b570419be77dd43 # v3.1.1
)

FetchContent_MakeAvailable(Catch2)
Expand Down

0 comments on commit c7e9a55

Please sign in to comment.