Skip to content

Coding style

Coding style #480

Workflow file for this run

name: CI
on:
push:
pull_request:
branches: [main]
env:
BUILD_TYPE: Release
INSTALL_LOCATION: .local
jobs:
build:
strategy:
fail-fast: false
matrix:
boost_version: [1.79.0, 1.80.0, 1.81.0, 1.82.0, 1.83.0, 1.84.0]
shared: [ON, OFF]
toolchain:
[
{
name: "Ubuntu GCC TLS",
cxx: "g++-11",
cc: "gcc-11",
packages: "libssl-dev gcc-11 g++-11",
tls: ON,
os: ubuntu-latest,
},
{
name: "Ubuntu GCC",
cxx: "g++-11",
cc: "gcc-11",
packages: "gcc-11 g++-11",
tls: OFF,
os: ubuntu-latest,
},
{
name: "Ubuntu Clang TLS",
cxx: "clang++",
cc: "clang",
packages: "libssl-dev",
tls: ON,
os: ubuntu-latest,
},
{
name: "Ubuntu Clang",
cxx: "clang++",
cc: "clang",
packages: "",
tls: OFF,
os: ubuntu-latest,
},
{
name: "VS2019",
cxx: "cl.exe",
cc: "cl.exe",
tls: OFF,
packages: "openssl", # We have to install something
os: windows-latest,
},
]
continue-on-error: false
runs-on: ${{ matrix.toolchain.os }}
env:
BOOST_ROOT: ${{github.workspace}}/3rdparty/boost-${{ matrix.boost_version }}
CC: ${{ matrix.toolchain.cc }}
CXX: ${{ matrix.toolchain.cxx }}
name: "${{ matrix.toolchain.name }} (boost v${{ matrix.boost_version }}) (shared: ${{ matrix.shared }})"
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v4
- name: cache boost
uses: actions/cache@v3
id: cache-boost
with:
path: ${{ env.BOOST_ROOT }}
key: boost-${{ matrix.boost_version }}
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup boost env
run: |
BOOST_URL="https://boostorg.jfrog.io/artifactory/main/release/${{ matrix.boost_version }}/source/boost_$(echo ${{ matrix.boost_version }} | sed 's/\./_/g').tar.bz2"
echo "BOOST_URL=$BOOST_URL" >> $GITHUB_ENV
shell: bash
- name: Install packages (via choco)
if: runner.os == 'Windows'
run: choco upgrade ${{ matrix.toolchain.packages }}
- name: Install packages (via apt)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install ${{ matrix.toolchain.packages }} -y
- name: Install packages (via homebrew)
if: runner.os == 'macOS'
run: brew install ${{ matrix.toolchain.packages }}
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
if [ "$OS" == "Windows_NT" ]; then
# fix up paths to be forward slashes consistently
BOOST_ROOT=$(echo $BOOST_ROOT | sed 's/\\/\//g')
fi
mkdir -p $BOOST_ROOT
curl --progress-bar --location --output $BOOST_ROOT/download.tar.bz2 $BOOST_URL
7z -o$BOOST_ROOT x $BOOST_ROOT/download.tar.bz2 -y -bd
7z -o$BOOST_ROOT x $BOOST_ROOT/download.tar -y -bd
cd $BOOST_ROOT && cp -r boost_*/* .
rm -rf boost_*/* download.tar.bz2 download.tar
shell: bash
- name: Install msvc
if: ${{ matrix.toolchain.cxx == 'cl.exe' }} # This is a bit of a hack
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
run: cmake -Bbuild -GNinja -DMALLOY_BUILD_EXAMPLES=ON -DMALLOY_BUILD_TESTS=ON -DMALLOY_FEATURE_TLS=${{ matrix.toolchain.tls }} -DMALLOY_BUILD_SHARED=${{ matrix.shared }}
- name: Build
run: cmake --build build
- name: Run tests
run: ./build/bin/malloy-tests