Skip to content

Doc20240112

Doc20240112 #232

Workflow file for this run

name: CI Build & Test
# Triggers the workflow on push or pull request events
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
include:
# macOS builds
# ~~~~~~~~~~~~
- name: macOS-12/Xcode/Debug
build_type: Debug
generator: Xcode
os: macos-12
- name: macOS-12/Xcode/Release
build_type: Release
generator: Xcode
os: macos-12
# Ubuntu builds
# ~~~~~~~~~~~~~
- name: Ubuntu-22.04/gcc-13/Debug
apt_install: cmake g++-13 libstdc++-13-dev ninja-build
build_type: Debug
cxx_compiler: -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_C_COMPILER=gcc-13
generator: Ninja
os: ubuntu-22.04
- name: Ubuntu-22.04/gcc-13/Release
apt_install: cmake g++-13 libstdc++-13-dev ninja-build
build_type: Release
cxx_compiler: -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_C_COMPILER=gcc-13
generator: Ninja
os: ubuntu-22.04
- name: Ubuntu-22.04/clang-16/Debug
apt_install: cmake ninja-build
llvm_install: 16
build_type: Debug
cxx_compiler: -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16
generator: Ninja
options: -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold
os: ubuntu-22.04
- name: Ubuntu-22.04/clang-16/Release
apt_install: cmake ninja-build
llvm_install: 16
build_type: Release
cxx_compiler: -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16
generator: Ninja
options: -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold
os: ubuntu-22.04
- name: Ubuntu-22.04/clang-14/Release/C++17
apt_install: cmake clang-14 libc++-dev libc++abi-dev ninja-build
build_type: Release
cxx_compiler: -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14
generator: Ninja
options: -DICUBABY_CXX17=Yes -DICUBABY_LIBCXX=Yes -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold
os: ubuntu-22.04
# Windows builds
# ~~~~~~~~~~~~~~
- name: Windows-latest/VS2022/Debug
build_type: Debug
generator: Visual Studio 17 2022
os: windows-latest
- name: Windows-latest/VS2022/Release
build_type: Release
generator: Visual Studio 17 2022
os: windows-latest
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'True'
- name: Install Dependencies (Linux)
if: startsWith (matrix.os, 'ubuntu-') && matrix.apt_install != ''
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.apt_install }}
- name: Install Dependencies (LLVM)
if: matrix.llvm_install != ''
run: |
wget https://apt.llvm.org/llvm.sh
# Verify that the file we downloaded is as we expected.
cat << 'EOF' | sha256sum --check
7dbc0855dff7d1a5b4eb71a209ab3dd9b8654d67e55daa1e49180dd1d97a1bcf llvm.sh
EOF
# Force --yes to the end of the add-apt-repository command to
# prevent the llvm.sh script hanging.
sed -ie "/^add-apt-repository/ s/$/ --yes/" llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{matrix.llvm_install}}
- name: Create Build Environment
shell: bash
run: cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake
shell: bash
run: |
cmake -S "${{ github.workspace }}" \
-B "${{ github.workspace }}/build" \
-G "${{ matrix.generator }}" \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D ICUBABY_WERROR=Yes \
${{ matrix.cxx_compiler }} \
${{ matrix.options }}
- name: Build
shell: bash
run: cmake --build "${{ github.workspace }}/build" --config ${{ matrix.build_type }}