Skip to content

Commit

Permalink
Merge branch 'hotfix/macos-cicd'
Browse files Browse the repository at this point in the history
  • Loading branch information
muit committed Oct 1, 2023
2 parents b180e97 + 27c2fd1 commit c3ad8dc
Showing 1 changed file with 21 additions and 46 deletions.
67 changes: 21 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,81 +12,56 @@ on:
jobs:
Build:
name: ${{ matrix.os-name }} (${{ matrix.compiler }}, ${{ matrix.config }})
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os-name }}-latest
strategy:
fail-fast: false
matrix:
name: [windows-msvc, windows-clang, linux-clang, linux-gcc, macos-clang]
config: [Release, Debug]
include:
- name: windows-msvc
os: windows-latest
os-name: windows
compiler: msvc
compiler: msvc-17
cxx: cl
cc: cl
- name: windows-clang
os: windows-latest
os-name: windows
compiler: clang
compiler: clang-16
cxx: clang-cl
cc: clang-cl
- name: linux-clang
os: ubuntu-latest
os-name: linux
compiler: clang
compiler: clang-16
cxx: clang++
cc: clang
- name: linux-gcc
os: ubuntu-latest
os-name: linux
compiler: gcc
cxx: g++-13
cc: gcc-13
compiler: gcc-13
cxx: g++
cc: gcc
- name: macos-clang
os: macos-13
os-name: macos
compiler: clang
compiler: clang-16
cxx: clang++
cc: clang
#- name: macos-gcc
# os-name: macos
# compiler: gcc-13
# cxx: /usr/bin/g++
# cc: /usr/bin/gcc
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Get CMake
uses: lukka/get-cmake@latest

- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.compiler == 'cl' }}

- name: Cache Clang
if: ${{ matrix.compiler == 'clang' }}
id: cache-llvm
uses: actions/cache@v3
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
path: ${{ runner.temp }}/llvm
key: llvm-16-${{ matrix.os-name }}
- name: Install Clang
if: ${{ matrix.compiler == 'clang' && matrix.os-name != 'macos' }}
uses: KyleMayes/install-llvm-action@v1
with:
version: "16.0"
directory: ${{ runner.temp }}/llvm
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Install LLVM (macos)
if: ${{ matrix.compiler == 'clang' && matrix.os-name == 'macos' }}
run: |
brew install llvm@16
echo /usr/local/opt/llvm@16/bin >> $GITHUB_PATH
- name: Install GCC (linux)
if: ${{ matrix.os-name == 'linux' }}
run: |
sudo apt install g++-13 gcc-13 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ matrix.os-name == 'windows' }}
cmake: true
ninja: true

- name: Cache Build
uses: actions/cache@v3
Expand All @@ -95,14 +70,14 @@ jobs:
key: ${{ matrix.os-name }}-${{ matrix.compiler }}-${{ matrix.config }}-build-${{ secrets.VCACHE}}

- name: Configure
run: cmake -S . -B Build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
run: cmake -GNinja -S . -B Build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{matrix.cxx}}

- name: Build
run: cmake --build Build --config ${{ matrix.config }}

- name: Upload binaries as artifacts
uses: actions/upload-artifact@v3
if: ${{ matrix.config == 'Release' && matrix.compiler == 'clang' }} # Only clang artifacts are stored
if: ${{ matrix.config == 'Release' && contains(matrix.compiler, 'clang') }} # Only clang artifacts are stored
with:
name: pipe-${{ matrix.os-name }}
path: Build/Bin
Expand Down

0 comments on commit c3ad8dc

Please sign in to comment.