Skip to content

Commit

Permalink
Merge pull request #4449 from hummeltech/macOSCI
Browse files Browse the repository at this point in the history
`macos-latest` was migrated from `macOS 12` on `amd64` to `macOS 14` on `arm64`
  • Loading branch information
artemp committed May 6, 2024
2 parents f84c30f + 09067f5 commit f89f221
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run_tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ runs:
shell: "bash"
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
LCOV_EXTRA_OPTIONS="--ignore-errors gcov --ignore-errors inconsistent --ignore-errors unused"
LCOV_EXTRA_OPTIONS="--ignore-errors count,gcov,inconsistent,range,unused --keep-going"
fi
lcov ${LCOV_EXTRA_OPTIONS:-} --directory . --capture --output-file coverage.info
lcov ${LCOV_EXTRA_OPTIONS:-} --remove coverage.info '/usr/*' '*/vcpkg_installed/*' '/.cache/*' '*/test/*' --output-file coverage.info
Expand Down
36 changes: 25 additions & 11 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,24 @@ jobs:
Build & Test
(${{ matrix.os }})
(C++ ${{ matrix.cxx-standard }})
${{ startsWith(matrix.os, 'macos-') && (matrix.os == 'macos-14' && '(ARM64)' || '(AMD64)') || '' }}
needs: checkSource
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
cxx-standard: [17]
os:
- macos-13
- macos-14
- ubuntu-latest
- windows-latest
cxx-standard:
- 17
include:
- os: ubuntu-latest
- os: macos-13
mono: mono
- os: macos-14
mono: mono
- os: macos-latest
- os: ubuntu-latest
mono: mono
- os: windows-latest

Expand Down Expand Up @@ -75,15 +83,21 @@ jobs:
nuget-pat: ${{ secrets.GITHUB_TOKEN }}
mono: ${{ matrix.mono }}

- id: lc_platform
uses: ASzc/change-string-case-action@v6
with:
string: ${{ runner.os }}

- name: set lower case runner os
- name: Set PRESET environment variable to lower case runner OS
shell: bash
run: |
echo "PRESET=${{ steps.lc_platform.outputs.lowercase }}-ci" >>${GITHUB_ENV}
LC_RUNNER_OS=$(echo "${RUNNER_OS}" | perl -ne "print lc")
if [ "${RUNNER_OS}" == "macOS" ]; then
MACOS_ARCH=${{ (matrix.os == 'macos-14' || matrix.os == 'macos-latest') && 'arm64' || 'x64' }}
echo "PRESET=${LC_RUNNER_OS}-ci-${MACOS_ARCH}" >> ${GITHUB_ENV}
else
echo "PRESET=${LC_RUNNER_OS}-ci" >> ${GITHUB_ENV}
fi
- name: Ensure libtool is installed on macOS
shell: bash
run: brew install libtool
if: runner.os == 'macOS'

- name: Configure CMake
shell: bash
Expand Down
37 changes: 32 additions & 5 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,23 @@
}
},
{
"name": "macos-ci",
"name": "macos-ci-arm64",
"description": "used by the ci pipeline",
"inherits": [
"use-ninja",
"release-with-debug-build",
"default-build-dir",
"ci-options"
],
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-fprofile-arcs -ftest-coverage"
},
"environment": {
"PROJ_LIB": "${sourceDir}/build/vcpkg_installed/arm64-osx/share/proj"
}
},
{
"name": "macos-ci-x64",
"description": "used by the ci pipeline",
"inherits": [
"use-ninja",
Expand Down Expand Up @@ -282,8 +298,12 @@
"configurePreset": "linux-ci-release"
},
{
"name": "macos-ci",
"configurePreset": "macos-ci"
"name": "macos-ci-arm64",
"configurePreset": "macos-ci-arm64"
},
{
"name": "macos-ci-x64",
"configurePreset": "macos-ci-x64"
}
],
"testPresets": [
Expand Down Expand Up @@ -313,8 +333,15 @@
]
},
{
"name": "macos-ci",
"configurePreset": "macos-ci",
"name": "macos-ci-arm64",
"configurePreset": "macos-ci-arm64",
"inherits": [
"test-default"
]
},
{
"name": "macos-ci-x64",
"configurePreset": "macos-ci-x64",
"inherits": [
"test-default"
]
Expand Down

0 comments on commit f89f221

Please sign in to comment.