From 8bd725bf087030901cb63da4245ca0aa198ccc00 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Sun, 29 Oct 2023 19:00:20 -0400 Subject: [PATCH] fix(ci): Make sure Darwin is compiling with the correct compiler --- .github/workflows/test.yaml | 137 ++++++++++++++------------ ci_scripts/darwin_install_compiler.sh | 61 ------------ 2 files changed, 74 insertions(+), 124 deletions(-) delete mode 100644 ci_scripts/darwin_install_compiler.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 43faa386..d833023d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,34 +4,34 @@ on: push: jobs: - linux: - name: ${{ matrix.config.name }} - runs-on: ubuntu-22.04 - strategy: - matrix: - config: - - name: linux_gcc_9 - compiler: gcc - compiler_version: 9 - - name: linux_gcc_12 - compiler: gcc - compiler_version: 12 - - name: linux_clang_12 - compiler: clang - compiler_version: 12 - - name: linux_clang_15 - compiler: clang - compiler_version: 15 - container: - image: quay.io/richiesams/docker_${{ matrix.config.compiler }}:${{ matrix.config.compiler_version }} - steps: - - uses: actions/checkout@v4 - - name: Build Debug - run: make CMAKE_PRESET=Unix_x64_Debug generate build - - name: Build Release - run: make CMAKE_PRESET=Unix_x64_Release generate build - - name: Test - run: make test + # linux: + # name: ${{ matrix.config.name }} + # runs-on: ubuntu-22.04 + # strategy: + # matrix: + # config: + # - name: linux_gcc_9 + # compiler: gcc + # compiler_version: 9 + # - name: linux_gcc_12 + # compiler: gcc + # compiler_version: 12 + # - name: linux_clang_12 + # compiler: clang + # compiler_version: 12 + # - name: linux_clang_15 + # compiler: clang + # compiler_version: 15 + # container: + # image: quay.io/richiesams/docker_${{ matrix.config.compiler }}:${{ matrix.config.compiler_version }} + # steps: + # - uses: actions/checkout@v4 + # - name: Build Debug + # run: make CMAKE_PRESET=Unix_x64_Debug generate build + # - name: Build Release + # run: make CMAKE_PRESET=Unix_x64_Release generate build + # - name: Test + # run: make test darwin: name: ${{ matrix.config.name }} runs-on: macOS-13 @@ -39,51 +39,62 @@ jobs: matrix: config: - name: darwin_gcc_9 - compiler: gcc - compiler_version: 9 + brew_package: gcc@9 + cc: /opt/homebrew/bin/gcc-9 + cxx: /opt/homebrew/bin/g++-9 - name: darwin_gcc_12 - compiler: gcc - compiler_version: 12 + brew_package: gcc@12 + cc: /opt/homebrew/bin/gcc-12 + cxx: /opt/homebrew/bin/g++-12 - name: darwin_clang_12 - compiler: clang - compiler_version: 12 + brew_package: llvm@12 + cc: /opt/homebrew/bin/clang-12 + cxx: /opt/homebrew/bin/clang++-12 - name: darwin_clang_15 - compiler: clang - compiler_version: 15 + brew_package: llvm@15 + cc: /opt/homebrew/bin/clang-15 + cxx: /opt/homebrew/bin/clang++-15 env: - COMPILER: ${{ matrix.config.compiler }} - VERSION: ${{ matrix.config.compiler_version }} + CC: ${{ matrix.config.cc }} + CXX: ${{ matrix.config.cxx }} steps: - uses: actions/checkout@v4 - name: Install - run: bash ci_scripts/darwin_install_compiler.sh + run: | + brew install ${{ matrix.config.brew_package }} + brew link ${{ matrix.config.brew_package }} + - name: Temp + run: | + ls -la /usr/local/opt + ls -la /opt/homebrew + ls -la /opt/homebrew/bin - name: Build Debug run: make CMAKE_PRESET=Unix_x64_Debug generate build - name: Build Release run: make CMAKE_PRESET=Unix_x64_Release generate build - name: Test run: make test - windows: - name: ${{ matrix.config.name }} - runs-on: ${{ matrix.config.os }} - strategy: - matrix: - config: - - name: windows_vs_2019 - os: windows-2019 - compiler_version: 2019 - - name: windows_vs_2022 - os: windows-2022 - compiler_version: 2022 - steps: - - uses: actions/checkout@v4 - - uses: ilammy/msvc-dev-cmd@v1 - with: - vsversion: "${{ matrix.compiler_version }}" - - uses: seanmiddleditch/gha-setup-ninja@master - - name: Build Debug - run: make CMAKE_PRESET=Win_x64_Debug generate build - - name: Build Release - run: make CMAKE_PRESET=Win_x64_Release generate build - - name: Test - run: make test + # windows: + # name: ${{ matrix.config.name }} + # runs-on: ${{ matrix.config.os }} + # strategy: + # matrix: + # config: + # - name: windows_vs_2019 + # os: windows-2019 + # compiler_version: 2019 + # - name: windows_vs_2022 + # os: windows-2022 + # compiler_version: 2022 + # steps: + # - uses: actions/checkout@v4 + # - uses: ilammy/msvc-dev-cmd@v1 + # with: + # vsversion: "${{ matrix.compiler_version }}" + # - uses: seanmiddleditch/gha-setup-ninja@master + # - name: Build Debug + # run: make CMAKE_PRESET=Win_x64_Debug generate build + # - name: Build Release + # run: make CMAKE_PRESET=Win_x64_Release generate build + # - name: Test + # run: make test diff --git a/ci_scripts/darwin_install_compiler.sh b/ci_scripts/darwin_install_compiler.sh deleted file mode 100644 index 1292708a..00000000 --- a/ci_scripts/darwin_install_compiler.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -set -x #echo on - -brew update -brew cask uninstall oclint - -upgradeBrewFormula () { - if brew ls --versions $1 > /dev/null - then - brew outdated $1 || brew upgrade $1 - else - brew install $1 - fi -} - - -case "${COMPILER}-${VERSION}" in -gcc-9) - upgradeBrewFormula gcc@9 - ;; -gcc-10) - upgradeBrewFormula gcc@10 - ;; -gcc-11) - upgradeBrewFormula gcc@11 - ;; -gcc-12) - upgradeBrewFormula gcc@12 - ;; -clang-12) - upgradeBrewFormula llvm@12 - # 12 is keg-only, so we have to set the full file path - export CC=/usr/local/opt/llvm@12/bin/clang - export CXX=/usr/local/opt/llvm@12/bin/clang++ - ;; -clang-13) - upgradeBrewFormula llvm@13 - # 13 is keg-only, so we have to set the full file path - export CC=/usr/local/opt/llvm@13/bin/clang - export CXX=/usr/local/opt/llvm@13/bin/clang++ - ;; -clang-14) - upgradeBrewFormula llvm@14 - # 14 is keg-only, so we have to set the full file path - export CC=/usr/local/opt/llvm@14/bin/clang - export CXX=/usr/local/opt/llvm@14/bin/clang++ - ;; -clang-15) - upgradeBrewFormula llvm@15 - # 15 is keg-only, so we have to set the full file path - export CC=/usr/local/opt/llvm@15/bin/clang - export CXX=/usr/local/opt/llvm@15/bin/clang++ - ;; -clang-16) - upgradeBrewFormula llvm@16 - # 16 is keg-only, so we have to set the full file path - export CC=/usr/local/opt/llvm@16/bin/clang - export CXX=/usr/local/opt/llvm@16/bin/clang++ - ;; -*) echo "Compiler not supported: ${COMPILER}-${VERSION}. See travis_ci_install_osx.sh"; exit 1 ;; -esac