ci: enabled sanitizer tests for macOS
The arm64 and x86_64 architectures with clang/gcc compiler were added
to the matrix.
Also, the 'setup-sanitizers-macos' action supplied with
the 'list available compilers' commands in one of it's job.
It helps to get the answer to the question:
'Which compiler we can select just now with our current environment?'
The 'setup-sanitizers-linux' build job extended with such commands also.
diff --git a/.github/actions/setup-sanitizers-linux/action.yml b/.github/actions/setup-sanitizers-linux/action.yml
index 18f5a75d..9744e5dd 100644
--- a/.github/actions/setup-sanitizers-linux/action.yml
+++ b/.github/actions/setup-sanitizers-linux/action.yml
@@ -17,7 +17,7 @@ runs:
NPROC=$(nproc)
echo CMAKE_BUILD_PARALLEL_LEVEL=$(($NPROC + 1)) | tee -a $GITHUB_ENV
shell: bash
- - name: Install build and test dependencies
+ - name: Install build and test dependencies. List available compilers.
run: |
apt -y update
echo Available compilers:
diff --git a/.github/actions/setup-sanitizers-macos/action.yml b/.github/actions/setup-sanitizers-macos/action.yml
index 9836ea03..d2160faa 100644
--- a/.github/actions/setup-sanitizers-macos/action.yml
+++ b/.github/actions/setup-sanitizers-macos/action.yml
@@ -8,13 +8,15 @@ inputs:
runs:
using: composite
steps:
+ - name: Setup CI environment on macOS
+ uses: ./.github/actions/setup-macos
- name: Get compiler version from cc_name
shell: bash
env:
CC_NAME: ${{ inputs.cc_name }}
run: |
echo CC_VERSION=`echo ${CC_NAME} | sed 's/.*-//'` | tee -a $GITHUB_ENV
- - name: Get brew formula from cc_name
+ - name: Get brew formula from cc_name. List available compilers.
shell: bash
env:
CC_FORMULA_NAME: |-
@@ -26,38 +28,13 @@ runs:
run: |
echo CC_FORMULA=${CC_FORMULA_NAME}@${CC_VERSION} | tee -a $GITHUB_ENV
echo Available formulas: `brew search ${CC_FORMULA_NAME}`
- - name: Setup CI environment
- uses: ./.github/actions/setup
- - name: Set CMAKE_BUILD_PARALLEL_LEVEL
+ - name: Install specified compiler
shell: bash
run: |
- # Set CMAKE_BUILD_PARALLEL_LEVEL environment variable to
- # limit the number of parallel jobs for build/test step.
- NPROC=$(sysctl -n hw.logicalcpu 2>/dev/null)
- echo CMAKE_BUILD_PARALLEL_LEVEL=$(($NPROC + 1)) | tee -a $GITHUB_ENV
- - name: Set MACOSX_DEPLOYMENT_TARGERT
- shell: bash
- run: |
- # Set required MACOSX_DEPLOYMENT_TARGERT environment
- # variable for Makefile.original build.
- # See https://github.com/LuaJIT/LuaJIT/issues/484,
- # https://github.com/LuaJIT/LuaJIT/issues/653.
- echo MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion) | tee -a $GITHUB_ENV
- - name: Install build and test dependencies
- shell: bash
- run: |
- # Install brew using the command from Homebrew repository
- # instructions: https://github.com/Homebrew/install.
- # XXX: 'echo' command below is required since brew
- # installation script obliges the one to enter a newline
- # for confirming the installation via Ruby script.
- brew update ||
- echo | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install
)"
# Try to install the packages either upgrade it to avoid
# of fails if the package already exists with the previous
# version.
- brew install --force ${CC_FORMULA} cmake make ninja perl ||
- brew upgrade ${CC_FORMULA} cmake make ninja perl
+ brew install --force ${CC_FORMULA} || brew upgrade ${CC_FORMULA}
- name: Set specific C compiler as a default toolchain for cmake
shell: bash
env:
Best regards,
Evgeniy Temirgaleev