diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4ad632b3d..c1cacd580 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,9 +3,9 @@ name: tests on: [push, pull_request] jobs: - # OSX tests do not run in Docker, and use the actions-rs Rust installaction - tests-osx: - name: tests (Mac OS X latest) + # MacOS tests do not run in Docker, and use the actions-rs Rust installaction + tests-macos-12: + name: tests (Mac OS 12.latest) runs-on: macos-latest steps: - uses: actions/checkout@v3 @@ -27,8 +27,35 @@ jobs: toolchain: "stable" override: true - - name: Test OSX - run: bash test/scripts/test_osx.sh + - name: Test MacOS + run: bash test/scripts/test_macos.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tests-macos-13: + name: tests (Mac OS 13.latest) + runs-on: macos-13 + steps: + - uses: actions/checkout@v3 + + - name: Cache cargo registry + uses: actions/cache@v3 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-stable-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo build + uses: actions/cache@v3 + with: + path: target + key: ${{ runner.os }}-stable-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions-rs/toolchain@v1 + with: + toolchain: "stable" + override: true + + - name: Test MacOS + run: bash test/scripts/test_macos.sh env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -88,4 +115,4 @@ jobs: run: docker-compose run test-$CONTAINER env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CONTAINER: ${{ matrix.dockerfile }} + CONTAINER: ${{ matrix.dockerfile }} \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c126b6e0a..7656becf9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,6 +55,11 @@ add_executable (lex_executable lex.cpp) target_link_libraries (task_executable task tc tc-rust commands tc columns libshared task libshared ${TASK_LIBRARIES}) target_link_libraries (calc_executable task tc tc-rust commands tc columns libshared task libshared ${TASK_LIBRARIES}) target_link_libraries (lex_executable task tc tc-rust commands tc columns libshared task libshared ${TASK_LIBRARIES}) +if (DARWIN) + target_link_libraries (task_executable "-framework CoreFoundation -framework Security") + target_link_libraries (calc_executable "-framework CoreFoundation -framework Security") + target_link_libraries (lex_executable "-framework CoreFoundation -framework Security") +endif (DARWIN) set_property (TARGET task_executable PROPERTY OUTPUT_NAME "task") @@ -66,4 +71,4 @@ set_property (TARGET lex_executable PROPERTY OUTPUT_NAME "lex") #SET(CMAKE_BUILD_TYPE gcov) #SET(CMAKE_CXX_FLAGS_GCOV "--coverage") #SET(CMAKE_C_FLAGS_GCOV "--coverage") -#SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage") +#SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage") \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dd6c1a5a2..b28c60c1d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -30,6 +30,9 @@ add_custom_target (build_tests DEPENDS ${test_SRCS} foreach (src_FILE ${test_SRCS}) add_executable (${src_FILE} "${src_FILE}.cpp" test.cpp) target_link_libraries (${src_FILE} task tc commands columns libshared task tc tc-rust commands columns libshared task commands columns libshared ${TASK_LIBRARIES}) + if (DARWIN) + target_link_libraries (${src_FILE} "-framework CoreFoundation -framework Security") + endif (DARWIN) endforeach (src_FILE) configure_file(run_all run_all COPYONLY) diff --git a/test/scripts/test_osx.sh b/test/scripts/test_macos.sh old mode 100644 new mode 100755 similarity index 77% rename from test/scripts/test_osx.sh rename to test/scripts/test_macos.sh index 2eb3e3e1d..cc86ece07 --- a/test/scripts/test_osx.sh +++ b/test/scripts/test_macos.sh @@ -1,6 +1,5 @@ set -ex -export LDFLAGS="-framework Foundation -framework Security" brew install cmake brew install libfaketime git clean -dfx @@ -15,4 +14,4 @@ pushd test make ./run_all -v cat all.log | grep 'not ok' -./problems +./problems \ No newline at end of file