From ec4316aa8477ed3456adc85567c44a6079d4d5e1 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Sun, 25 Jul 2021 12:25:31 -0400 Subject: [PATCH] Adding macos testing. (#1670) --- .github/workflows/macos.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000..ca7126ab --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,33 @@ +name: Macos + +on: [push, pull_request] + +jobs: + macos-build: + if: >- + ! contains(toJSON(github.event.commits.*.message), '[skip ci]') && + ! contains(toJSON(github.event.commits.*.message), '[skip github]') + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: dependencies/.cache + key: ${{ hashFiles('dependencies/CMakeLists.txt') }} + - name: Use cmake + run: | + mkdir builddebug && + cd builddebug && + cmake -DCMAKE_BUILD_TYPE=Debug -DSIMDJSON_GOOGLE_BENCHMARKS=OFF -DSIMDJSON_DEVELOPER_MODE=ON -DBUILD_SHARED_LIBS=OFF .. && + cmake --build . && + ctest -j --output-on-failure -LE explicitonly && + cd .. && + mkdir build && + cd build && + cmake -DSIMDJSON_GOOGLE_BENCHMARKS=ON -DSIMDJSON_DEVELOPER_MODE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX:PATH=destination .. && + cmake --build . && + ctest -j --output-on-failure -LE explicitonly && + cmake --install . && + echo -e '#include \nint main(int argc,char**argv) {simdjson::dom::parser parser;simdjson::dom::element tweets = parser.load(argv[1]); }' > tmp.cpp && c++ -Idestination/include -Ldestination/lib -std=c++17 -Wl,-rpath,destination/lib -o linkandrun tmp.cpp -lsimdjson && ./linkandrun jsonexamples/twitter.json && + cd ../tests/installation_tests/find && + mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=../../../build/destination .. && cmake --build .