Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Cover build on macOS #108

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
# Licensed under Apache License Version 2.0

name: Build on Linux
name: Build on Linux/macOS

# Drop permissions to minimum, for security
permissions:
Expand All @@ -16,7 +16,7 @@ on:

jobs:
linux:
name: Build (${{ matrix.cc }})
name: Build (${{ matrix.cc }} on ${{ matrix.runs-on }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
Expand All @@ -37,28 +37,46 @@ jobs:
clang_major_version: 18
clang_repo_suffix:
runs-on: ubuntu-22.04
- cc: gcc-13
cxx: g++-13
clang_major_version: null
clang_repo_suffix: null
runs-on: macos-12
- cc: clang-15
cxx: clang++-15
clang_major_version: 15
clang_repo_suffix: null
runs-on: macos-12
steps:
- name: Add Clang/LLVM repositories
if: "${{ contains(matrix.cxx, 'clang') }}"
if: "${{ runner.os == 'Linux' && contains(matrix.cxx, 'clang') }}"
run: |-
set -x
source /etc/os-release
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}${{ matrix.clang_repo_suffix }} main"

- name: Install build dependencies
if: "${{ runner.os == 'Linux' }}"
run: |-
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
libncurses-dev \
pkg-config

- name: Install build dependency Clang ${{ matrix.clang_major_version }}
if: "${{ contains(matrix.cxx, 'clang') }}"
if: "${{ runner.os == 'Linux' && contains(matrix.cxx, 'clang') }}"
run: |-
sudo apt-get install --yes --no-install-recommends -V \
clang-${{ matrix.clang_major_version }}

- name: Add versioned aliases for Clang ${{ matrix.clang_major_version }}
if: "${{ runner.os == 'macOS' && contains(matrix.cxx, 'clang') }}"
run: |-
set -x
sudo ln -s "$(brew --prefix llvm@${{ matrix.clang_major_version }})"/bin/clang /usr/local/bin/clang-${{ matrix.clang_major_version }}
sudo ln -s "$(brew --prefix llvm@${{ matrix.clang_major_version }})"/bin/clang++ /usr/local/bin/clang++-${{ matrix.clang_major_version }}

- name: Checkout Git branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

Expand Down