Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable tests for #202 on macOS with Xcode 12+, add catalina workflow #414

Merged
merged 3 commits into from
Nov 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: macOS latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, we should use this template for the other libraries too! gazebo-tooling/action-gz-ci#25


on: [push, pull_request]

jobs:
build:

env:
PACKAGE: sdformat8
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: brew config

- name: Install base dependencies
run: |
brew tap osrf/simulation;
brew install --only-dependencies ${PACKAGE};

- run: mkdir build
- name: cmake
working-directory: build
run: cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/${PACKAGE}/HEAD
- run: make
working-directory: build
- run: make test
working-directory: build
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: make install
working-directory: build
run: |
make install;
brew link ${PACKAGE};
- name: Compile example code
working-directory: examples
run: |
mkdir build;
cd build;
cmake ..;
make;
./simple ../simple.sdf;
16 changes: 8 additions & 8 deletions src/SDF_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ TEST(SDF, UpdateElement)
staticParam->Get(flagCheck);
EXPECT_EQ(flagCheck, fixture.flag);
poseParam->Get(poseCheck);
// test fails on homebrew see issue 202
// test fails on homebrew with Xcode 11 and earlier, see issue 202
// https://github.com/osrf/sdformat/issues/202
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ < 12)
EXPECT_EQ(poseCheck, fixture.pose);
#endif
}
Expand Down Expand Up @@ -419,9 +419,9 @@ TEST(SDF, GetAny)
}
catch(std::bad_any_cast &/*_e*/)
{
// test fails on homebrew see issue 202
// test fails on homebrew with Xcode 11 and earlier, see issue 202
// https://github.com/osrf/sdformat/issues/202
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ < 12)
FAIL();
#endif
}
Expand All @@ -437,9 +437,9 @@ TEST(SDF, GetAny)
}
catch(std::bad_any_cast &/*_e*/)
{
// test fails on homebrew see issue 202
// test fails on homebrew with Xcode 11 and earlier, see issue 202
// https://github.com/osrf/sdformat/issues/202
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ < 12)
FAIL();
#endif
}
Expand Down Expand Up @@ -481,9 +481,9 @@ TEST(SDF, GetAny)
}
catch(std::bad_any_cast &/*_e*/)
{
// test fails on homebrew see issue 202
// test fails on homebrew with Xcode 11 and earlier, see issue 202
// https://github.com/osrf/sdformat/issues/202
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang_major__) && __clang_major__ < 12)
FAIL();
#endif
}
Expand Down