deskflow/.github/workflows/job-test-mac.yml
Nick Bolton d0a4c3d7a0
Use deps script to make life easier for contribs (#7351)
* Use deps script to make life easier for contribs

* Make readme more developer friendly

* YAML file to describe Linux deps

* Silent fail for yaml module (Python 3.6+)

* Move Qt install to deps script

* Update readme to add Windows command

* Fixed Linux package name

* Simplify env vars for workflow

* Exclude scripts from SonarCloud

* Move all deps config to .yml file

* Fixed exclude glob

* Simplify quickstart

* Fixed macOS deps config key name

* Fixed bug in Linux config read

* Use backslash for consistency

* Change SonarCloud path to /build/

* Fixed dep name

* Exclude scripts in CMake coverage

* Move script coverage exclusion to online config

* Use try/except instead of checking return value

* Fixed comment typo
2024-06-14 15:32:47 +00:00

71 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 }}
timeout-minutes: 20
defaults:
run:
shell: ${{ matrix.runtime.shell }}
strategy:
matrix:
runtime:
- name: "macos-10-intel"
os: "macos-14-large"
arch: x64
target: "10.14"
shell: "bash"
- name: "macos-11-m1"
os: "macos-14"
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 dependencies
run: |
pip install pyyaml
python ./scripts/install_deps.py
- name: Configure
env:
CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.runtime.target }}
run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
- name: Build
run: cmake --build build
- name: Run unit test
run: ./build/bin/unittests