deskflow/.github/workflows/job-test-mac.yml
Nick Bolton 55f68ed3e9
Switch to GitHub hosted Mac M1 runner (#7321)
* Switch to macos-latest-xlarge

* Improve job names

* Update create-release.yml

* Fixed workflow job names

* Further improve workflow naming

* Remove double checkout

* Rename Mac 11 workflow

* Remove redundant word

* Update ChangeLog

* Add matrix names for macOS

* Create test

* Delete test
2024-01-09 16:21:13 +00:00

72 lines
1.6 KiB
YAML

name: "Test macOS"
on:
push:
branches: [master]
pull_request:
branches: [master]
concurrency:
group: "${{ github.workflow }}-${{ github.ref || github.run_id }}"
cancel-in-progress: true
jobs:
test-macos:
runs-on: ${{ matrix.runtime.os }}
defaults:
run:
shell: ${{ matrix.runtime.shell }}
strategy:
matrix:
runtime:
- name: "macos-10-intel"
os: "macos-latest"
arch: x64
target: "10.14"
shell: "bash"
- name: "macos-11-m1"
os: "macos-latest-xlarge"
arch: arm64
target: "11"
shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}"
name: ${{ matrix.runtime.name }}
env:
GIT_COMMIT: ${{ github.sha }}
steps:
- name: Setup PATH
run: |
case "$ARCH" in
"arm64")
echo "/opt/homebrew/bin" >> $GITHUB_PATH
;;
esac
env:
ARCH: ${{ matrix.runtime.arch }}
- name: Checkout git repo
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Install brew dependencies
run: brew bundle --file=- <<< "brew 'qt5'; brew 'openssl'"
- name: Build
env:
CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.runtime.target }}
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt5);$(brew --prefix openssl)" ..
. ./version
make -j
- name: Run unit test
run: ./build/bin/unittests