From 1e36ae015a8b13c31dd65fbe017adabb7e0f6ee1 Mon Sep 17 00:00:00 2001 From: Spacetown <40258682+spacetown@users.noreply.github.com> Date: Thu, 29 Feb 2024 22:24:53 +0100 Subject: [PATCH] Add MacOs test runner --- .github/workflows/test.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f7a8f8943..65288e6fe4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,6 +112,14 @@ jobs: gcc: gcc-8 python-version: '3.11' + # Test minimum and maximum Python version on Windows. + - os: macos-12 + gcc: gcc + python-version: '3.8' + - os: macos-12 + gcc: gcc + python-version: '3.11' + steps: - uses: actions/checkout@v4 - name: Setup environment @@ -119,11 +127,16 @@ jobs: # Enable coverage for specific target configurations case "${{ matrix.os }}/${{ matrix.gcc }}/${{ matrix.python-version }}" in windows-2019/gcc-8/3.8) USE_COVERAGE=true ;; + macos-12/gcc-11/3.9) USE_COVERAGE=true ;; ubuntu-22.04/gcc-11/3.11) USE_COVERAGE=true ;; *) USE_COVERAGE=false ;; esac echo "USE_COVERAGE=$USE_COVERAGE" >> $GITHUB_ENV - echo "CC=${{ matrix.gcc }}" >> $GITHUB_ENV + + # Set the environment CC if gcc contains a version + if [ "${{ matrix.gcc }}" != "gcc" ] ; then + echo "CC=${{ matrix.gcc }}" >> $GITHUB_ENV + fi shell: bash - name: Install msys with GCC (Windows) @@ -135,7 +148,13 @@ jobs: if: ${{ startsWith(matrix.os,'windows-') }} run: | choco install ninja - - name: Install build commands and GCC (Linux) + - name: Install ninja and libxml2 (MacOs) + if: ${{ startsWith(matrix.os,'macos-') }} + run: | + brew update + brew install ninja + brew install libxml2 + - name: Install build commands, GCC and libxml2 (Linux) if: ${{ startsWith(matrix.os,'ubuntu-') }} run: | sudo apt update @@ -143,12 +162,7 @@ jobs: make \ ninja-build \ ${{ matrix.gcc }} \ - $(echo ${{ matrix.gcc }} | sed -e 's/gcc/g\+\+/') - sudo apt-get clean - - name: Install libxml2 - if: ${{ startsWith(matrix.os,'ubuntu-') }} - run: | - sudo apt-get install -y \ + $(echo ${{ matrix.gcc }} | sed -e 's/gcc/g\+\+/') \ libxml2-utils sudo apt-get clean - name: Set up Python ${{ matrix.python-version }}