Skip to content

Commit

Permalink
Attempt to run *BSD CI in VMs.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchisnall committed Feb 8, 2023
1 parent 627653a commit 19d7de9
Showing 1 changed file with 57 additions and 25 deletions.
82 changes: 57 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ on:
workflow_dispatch:

jobs:
unixlike:
linux:
if: false
strategy:
matrix:
# Build each combination of OS and release/debug variants
os: [ "ubuntu-latest", "ubuntu-18.04", "ubuntu-20.04", "macos-11", "macos-12", "freebsd-12.2", "freebsd-13.0" ]
os: [ "ubuntu-latest", "ubuntu-18.04", "ubuntu-20.04", "macos-11", "macos-12" ]
build-type: [ Release, Debug ]
# Extra cmake flags. GitHub Actions matrix overloads `include` to mean
# 'add extra things to a job' and 'add jobs'. You can add extra things
Expand Down Expand Up @@ -44,17 +45,6 @@ jobs:
dependencies: "rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
- os: "macos-12"
dependencies: "rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
# Skip the tests for the FreeBSD release builds
# Also build-test the checked memcpy implementation while doing these.
# It is run-tested on Linux and should be the same everywhere.
- os: "freebsd-13.0"
build-type: Release
build-only: yes
cmake-flags: "-DSNMALLOC_MEMCPY_BOUNDS=ON -DSNMALLOC_CHECK_LOADS=ON"
- os: "freebsd-12.2"
build-type: Debug
build-only: yes
cmake-flags: "-DSNMALLOC_MEMCPY_BOUNDS=ON -DSNMALLOC_CHECK_LOADS=ON"
# Add the self-host build, using the bounds-checked memcpy in
# maximally paranoid mode (checking loads and stores)
- os: "ubuntu-latest"
Expand All @@ -69,12 +59,6 @@ jobs:
build-type: Debug
self-host: true
extra-cmake-flags: "-DSNMALLOC_USE_PTHREAD_DESTRUCTORS=On"
# Add an extra element to the matrix that does a build with clang 12
# but doesn't run tests.
- os: "freebsd-13.0"
variant: Clang 12 (Build only)
extra-cmake-flags: "-DCMAKE_CXX_COMPILER=clang++12"
build-only: yes
# Check that we can build specifically with libstdc++
- os: "ubuntu-latest"
variant: "libstdc++ (Build only)"
Expand All @@ -98,7 +82,7 @@ jobs:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.variant }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install build dependencies
run: ${{ matrix.dependencies }}
- name: Configure CMake
Expand All @@ -125,7 +109,52 @@ jobs:
ninja clean
LD_PRELOAD=/usr/local/lib/libsnmallocshim-checks.so ninja
# GitHub doesn't natively support *BSD, but we can run them in VMs on Mac /
# Linux runners
bsd:
strategy:
matrix:
# Build each combination of OS, version, and release/debug variants
# FreeBSD and OpenBSD run on xhyve, netbsd needs qemu
os:
- name: freebsd
version: '13.1'
host: macos-12
dependencies: pkg ins -y cmake ninja
- name: freebsd
version: '12.4'
host: macos-12
dependencies: pkg ins -y cmake ninja
- name: openbsd
version: '7.2'
host: macos-12
dependencies: pkg_add -I cmake ninja
- name: netbsd
version: '9.2'
host: ubuntu-latest
dependencies: pkgin -y install cmake ninja
build-type: [ Release, Debug ]
# Don't abort runners if a single one fails
fail-fast: false
runs-on: ${{ matrix.os.host }}
name: ${{ matrix.os.name }}-${{ matrix.os.version}} ${{ matrix.build-type }}
steps:
- uses: actions/checkout@v3
- uses: cross-platform-actions/[email protected]
with:
operating_system: ${{ matrix.os.name }}
architecture: x86-64
version: ${{ matrix.os.version}}
shell: bash
run: |
sudo ${{ matrix.os.dependencies }}
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -G Ninja
cd ${{github.workspace}}/build
NINJA_STATUS="%p [%f:%s/%t] %o/s, %es" ninja
ctest --output-on-failure -j 4 -C ${{ matrix.build-type }} --timeout 400
sanitizer:
if: false
strategy:
matrix:
# Build just release variant as Debug is too slow.
Expand All @@ -147,7 +176,7 @@ jobs:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.variant }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install build dependencies
run: ${{ matrix.dependencies }}
- name: Configure CMake
Expand All @@ -161,6 +190,7 @@ jobs:
run: ctest --output-on-failure -j 4 -C ${{ matrix.build-type }} --timeout 400 -E "memcpy|external_pointer" --repeat-until-fail 2

qemu-crossbuild:
if: false
strategy:
matrix:
build-type: [ Release, Debug ]
Expand Down Expand Up @@ -197,7 +227,7 @@ jobs:
runs-on: ${{matrix.arch.host-os}}
name: ${{matrix.build-type}} cross-build for ${{ matrix.arch.triple }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: "Install cross-compile toolchain and QEMU (ubuntu-20.04)"
# Install the dependencies and clang 13. Earlier versions of clang don't
# find the multilib things for this week's Ubuntu filesystem layout.
Expand Down Expand Up @@ -257,6 +287,7 @@ jobs:
timeout-minutes: 30

windows:
if: false
strategy:
matrix:
# Build each combination of OS and release/debug variants
Expand Down Expand Up @@ -295,7 +326,7 @@ jobs:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.build-type }} ${{ matrix.toolchain }} ${{ matrix.variant }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -A ${{ matrix.arch }} ${{ matrix.toolchain }} ${{ matrix.extra-cmake-flags }} -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On
Expand All @@ -311,10 +342,11 @@ jobs:

# Job to run clang-format and report errors
format:
if: false
runs-on: ubuntu-18.04
# We don't need to do the build for this job, but we need to configure it to get the clang-format target
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DSNMALLOC_USE_CXX17=ON
- name: Install clang-tidy
Expand All @@ -335,7 +367,7 @@ jobs:
fi
all-checks:
needs: [unixlike, qemu-crossbuild, windows, format, sanitizer]
needs: [linux, bsd, qemu-crossbuild, windows, format, sanitizer]
runs-on: ubuntu-latest
steps:
- name: Dummy step
Expand Down

0 comments on commit 19d7de9

Please sign in to comment.