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

Simplify CI script and add alpine images #7

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
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
114 changes: 63 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,22 @@ jobs:
packages: write
timeout-minutes: 20

env:
DOCKER_BUILDKIT: 1

strategy:
fail-fast: false
matrix:
include:
- { distro: fedora, edition: 34, arch: ppc64le }
- { distro: fedora, edition: 34, arch: s390x }
- { distro: ubuntu, edition: focal, arch: arm64 }
- { distro: ubuntu, edition: focal, arch: ppc64el }
- { distro: ubuntu, edition: focal, arch: s390x }
- { distro: ubuntu, edition: focal, arch: x86_64 }
- { distro: ubuntu, edition: noble, arch: x86_64 }
- { dea: alpine-3.20-x86_64, distro: alpine, edition: '3.20', arch: x86_64 }
- { dea: alpine-edge-ppc64le, distro: alpine, edition: edge, arch: ppc64le }
- { dea: fedora-34-ppc64le, distro: fedora, edition: 34, arch: ppc64le }
- { dea: fedora-34-s390x, distro: fedora, edition: 34, arch: s390x }
- { dea: ubuntu-focal-arm64, distro: ubuntu, edition: focal, arch: arm64 }
- { dea: ubuntu-focal-ppc64el, distro: ubuntu, edition: focal, arch: ppc64el }
- { dea: ubuntu-focal-s390x, distro: ubuntu, edition: focal, arch: s390x }
- { dea: ubuntu-focal-x86_64, distro: ubuntu, edition: focal, arch: x86_64 }
- { dea: ubuntu-noble-x86_64, distro: ubuntu, edition: noble, arch: x86_64 }

steps:
- uses: actions/checkout@v4
Expand All @@ -47,9 +52,9 @@ jobs:
name=ghcr.io/${{ github.repository }},enable=${{ github.event_name == 'pull_request' && 'true' || 'false' }}
name=${{ github.repository }},enable=${{ github.event_name != 'pull_request' && 'true' || 'false' }}
tags: |
type=ref,event=pr,prefix=${{ matrix.distro }}-${{ matrix.edition }}-${{ matrix.arch }}-pr.
type=ref,event=tag,enable=${{ github.event.release.prerelease && 'true' || 'false' }},prefix=${{ matrix.distro }}-${{ matrix.edition }}-${{ matrix.arch }}-,suffix=-pre
type=ref,event=tag,enable=${{ github.event.release.prerelease && 'false' || 'true' }},prefix=${{ matrix.distro }}-${{ matrix.edition }}-${{ matrix.arch }}-
type=ref,event=pr,prefix=${{ matrix.dea }}-pr.
type=ref,event=tag,enable=${{ github.event.release.prerelease && 'true' || 'false' }},prefix=${{ matrix.dea }}-,suffix=-pre
type=ref,event=tag,enable=${{ github.event.release.prerelease && 'false' || 'true' }},prefix=${{ matrix.dea }}-
- uses: docker/setup-qemu-action@v3

Expand All @@ -73,19 +78,18 @@ jobs:
- uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.${{ matrix.distro }}-${{ matrix.edition }}.${{ matrix.arch }}
file: Dockerfile.${{ matrix.dea }}
push: true
annotations: ${{ steps.meta.outputs.annotations }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha,scope=${{ matrix.distro }}-${{ matrix.edition }}.${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.distro }}-${{ matrix.edition }}.${{ matrix.arch }}
cache-from: type=gha,scope=${{ matrix.dea }}
cache-to: type=gha,mode=max,scope=${{ matrix.dea }}

cache:
# cache the boost sources clone because they are used many times over
if: github.event_name == 'pull_request' || github.event.release.prerelease
name: Cache Boost Sources
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10

Expand Down Expand Up @@ -114,7 +118,9 @@ jobs:

test:
if: github.event_name == 'pull_request' || github.event.release.prerelease
needs: cache
needs:
- build
- cache
runs-on: ubuntu-latest
permissions:
packages: read
Expand All @@ -123,39 +129,45 @@ jobs:
strategy:
fail-fast: false
matrix:
distro:
- fedora
- ubuntu
edition:
- 34
- focal
- noble
arch:
- arm64
- ppc64el
- ppc64le
- s390x
- x86_64
dea:
- alpine-3.20-x86_64
- alpine-edge-ppc64le
- fedora-34-ppc64le
- fedora-34-s390x
- ubuntu-focal-arm64
- ubuntu-focal-ppc64el
- ubuntu-focal-s390x
- ubuntu-focal-x86_64
- ubuntu-noble-x86_64
toolset:
- clang
- gcc
stdlib:
- libc++
- native
include:
# alpine uses musl for libc, and the sanitizers do not support it
# asan and tsan were not working on s390x and ppc64, and were disabled
# ubuntu focal's tsan is busted: https://bugs.launchpad.net/ubuntu/+source/gcc-9/+bug/2029910
# building everything in emulation can take over 45 minutes
- { dea: alpine-3.20-x86_64, distro: alpine, edition: '3.20', arch: x86_64, asan: false, tsan: false, ubsan: false, valgrind: true, buildall: true }
- { dea: alpine-edge-ppc64le, distro: alpine, edition: edge, arch: ppc64le, asan: false, tsan: false, ubsan: false, valgrind: true, buildall: false }
- { dea: fedora-34-ppc64le, distro: fedora, edition: 34, arch: ppc64le, asan: false, tsan: false, ubsan: true , valgrind: true, buildall: false }
- { dea: fedora-34-s390x, distro: fedora, edition: 34, arch: s390x, asan: false, tsan: false, ubsan: true , valgrind: true, buildall: false }
- { dea: ubuntu-focal-arm64, distro: ubuntu, edition: focal, arch: arm64, asan: false, tsan: false, ubsan: true , valgrind: true, buildall: false }
- { dea: ubuntu-focal-ppc64el, distro: ubuntu, edition: focal, arch: ppc64el, asan: false, tsan: false, ubsan: true , valgrind: true, buildall: false }
- { dea: ubuntu-focal-s390x, distro: ubuntu, edition: focal, arch: s390x, asan: false, tsan: false, ubsan: true , valgrind: true, buildall: false }
- { dea: ubuntu-focal-x86_64, distro: ubuntu, edition: focal, arch: x86_64, asan: true, tsan: false, ubsan: true , valgrind: true, buildall: true }
- { dea: ubuntu-noble-x86_64, distro: ubuntu, edition: noble, arch: x86_64, asan: true, tsan: true, ubsan: true , valgrind: true, buildall: true }
exclude:
- { distro: fedora, edition: focal }
- { distro: fedora, edition: noble }
- { distro: fedora, edition: 34, arch: arm64 }
- { distro: fedora, edition: 34, arch: ppc64el }
- { distro: fedora, edition: 34, arch: x86_64 }
- { distro: ubuntu, edition: 34 }
- { distro: ubuntu, edition: focal, arch: ppc64le }
- { distro: ubuntu, edition: noble, arch: arm64 }
- { distro: ubuntu, edition: noble, arch: ppc64el }
- { distro: ubuntu, edition: noble, arch: ppc64le }
- { distro: ubuntu, edition: noble, arch: s390x }
# undefined reference to std::lock_guard<std::mutex>::lock_guard(std::mutex&)
- { distro: ubuntu, edition: focal, arch: s390x, toolset: clang }
# undefined reference to std::lock_guard<std::mutex>::lock_guard(std::mutex&) (missing a package?)
- { dea: ubuntu-focal-s390x, toolset: clang }
- { dea: ubuntu-focal-s390x, stdlib: libc++ }
# alpine uses musl, we're only supporting that for now as missing <cassert> errors were occurring
- { dea: alpine-3.20-x86_64, toolset: clang }
- { dea: alpine-3.20-x86_64, stdlib: libc++ }
- { dea: alpine-edge-ppc64le, toolset: clang }
- { dea: alpine-edge-ppc64le, stdlib: libc++ }

env:
BDDE_DISTRO: ${{ matrix.distro }}
Expand All @@ -177,9 +189,9 @@ jobs:
name=ghcr.io/${{ github.repository }},enable=${{ github.event_name == 'pull_request' && 'true' || 'false' }}
name=${{ github.repository }},enable=${{ github.event_name != 'pull_request' && 'true' || 'false' }}
tags: |
type=ref,event=pr,prefix=${{ matrix.distro }}-${{ matrix.edition }}-${{ matrix.arch }}-pr.
type=ref,event=tag,enable=${{ github.event.release.prerelease && 'true' || 'false' }},prefix=${{ matrix.distro }}-${{ matrix.edition }}-${{ matrix.arch }}-,suffix=-pre
type=ref,event=tag,enable=${{ github.event.release.prerelease && 'false' || 'true' }},prefix=${{ matrix.distro }}-${{ matrix.edition }}-${{ matrix.arch }}-
type=ref,event=pr,prefix=${{ matrix.dea }}-pr.
type=ref,event=tag,enable=${{ github.event.release.prerelease && 'true' || 'false' }},prefix=${{ matrix.dea }}-,suffix=-pre
type=ref,event=tag,enable=${{ github.event.release.prerelease && 'false' || 'true' }},prefix=${{ matrix.dea }}-
- uses: docker/setup-qemu-action@v3

Expand Down Expand Up @@ -241,26 +253,26 @@ jobs:
find ../../../bin.v2/libs/predef/test/info_as_cpp.test/ -name info_as_cpp.run -exec cat {} \;
- name: bdde-asan
if: matrix.asan
working-directory: ${{ env.BOOST_ROOT }}/libs/format
if: matrix.arch == 'x86_64'
run: bdde-asan ${{ env.B2_ARGS }}

- name: bdde-tsan
if: matrix.tsan
working-directory: ${{ env.BOOST_ROOT }}/libs/format
# https://bugs.launchpad.net/ubuntu/+source/gcc-9/+bug/2029910: focal's busted so only run on noble
if: matrix.arch == 'x86_64' && matrix.edition == 'noble'
run: bdde-tsan ${{ env.B2_ARGS }}

- name: bdde-ubsan
if: matrix.ubsan
working-directory: ${{ env.BOOST_ROOT }}/libs/format
run: bdde-ubsan ${{ env.B2_ARGS }}

- name: bdde-valgrind
if: matrix.valgrind
working-directory: ${{ env.BOOST_ROOT }}/libs/format
if: matrix.arch == 'x86_64'
run: bdde-ubsan ${{ env.B2_ARGS }}
run: bdde-valgrind ${{ env.B2_ARGS }}

- name: Build all
- name: Build everything
if: matrix.buildall
working-directory: ${{ env.BOOST_ROOT }}
if: matrix.arch == 'x86_64'
run: bdde b2 ${{ env.B2_ARGS }}
21 changes: 21 additions & 0 deletions Dockerfile.alpine-3.20-x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# syntax = edrevo/dockerfile-plus
#
# Copyright (c) 2018 - 2024 James E. King III
#
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Boost Docker Development Environment
# Requires DOCKER_BUILDKIT=1 (set by bdde-build)
#

FROM alpine:3.20

LABEL BDDE_ARCH="x86_64"
LABEL BDDE_DISTRO="alpine"
LABEL BDDE_EDITION="3.20"

INCLUDE+ Dockerfile.common
INCLUDE+ Dockerfile.alpine.common
INCLUDE+ Dockerfile.user
20 changes: 20 additions & 0 deletions Dockerfile.alpine-edge-ppc64le
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# syntax = edrevo/dockerfile-plus
#
# Copyright (c) 2018 - 2024 James E. King III
#
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Boost Docker Development Environment
#

FROM multiarch/alpine:ppc64le-edge

LABEL BDDE_ARCH="ppc64le"
LABEL BDDE_DISTRO="alpine"
LABEL BDDE_EDITION="edge"

INCLUDE+ Dockerfile.common
INCLUDE+ Dockerfile.alpine.common
INCLUDE+ Dockerfile.user
127 changes: 127 additions & 0 deletions Dockerfile.alpine.common
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#
# Copyright (c) 2018 - 2024 James E. King III
#
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Boost Docker Development Environment
#
# Common alpine family commands to install necessary files.
#

ENV CONTAINER_USER=boost

RUN apk add --no-interactive \
bzip2 \
clang \
cmake \
cppcheck \
curl \
file \
g++ \
gdb \
git \
lcov \
libc++-dev \
linux-headers \
make \
shadow \
sudo \
which \
unzip \
valgrind \
vim \
wget

#################################################################
## Boost Library Dependencies
## Do not "de-dupe" - this is a canonical list of dependencies!
#################################################################

# asio
RUN apk add --no-interactive \
openssl-dev

# beast
RUN apk add --no-interactive \
openssl-dev \
zlib-dev

# gil
RUN apk add --no-interactive \
jpeg \
libpng-dev \
tiff \
zlib-dev

# integer
RUN apk add --no-interactive \
gmp-dev

# interval (for one disabled example)
RUN apk add --no-interactive \
gmp-dev \
mpfr-dev

# iostreams
RUN apk add --no-interactive \
libbz2 \
xz-dev \
zlib-dev \
zstd-dev

# locale
RUN apk add --no-interactive \
icu-dev

# mpi
RUN apk add --no-interactive \
openmpi-dev

# python
RUN apk add --no-interactive \
python3-dev

# stacktrace
RUN mkdir /usr/local/src && \
cd /usr/local/src && \
git clone https://github.com/ianlancetaylor/libbacktrace.git && \
cd libbacktrace && \
./configure && \
make -j3 install && \
cd .. && \
rm -rf libbacktrace

# sync
# pthread-win32, but not on Unix

# thread
# pthread-win32, but not on Unix

#################################################################
# Prerequisites for boostbook (does what setup_boostbook.sh does)
# for documentation builds to work

RUN apk add --no-interactive \
libxslt-dev \
doxygen \
openjdk11-jre-headless

RUN cd /opt && \
wget --quiet http://sourceforge.net/projects/docbook/files/docbook-xsl/1.75.2/docbook-xsl-1.75.2.tar.gz && \
tar xzf docbook-xsl-1.75.2.tar.gz && \
rm docbook-xsl-1.75.2.tar.gz

RUN cd /opt && \
mkdir docbook-dtd-4.2 && \
cd docbook-dtd-4.2 && \
wget --quiet http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip && \
unzip -q docbook-xml-4.2.zip && \
rm docbook-xml-4.2.zip

RUN cd /opt && \
wget --quiet http://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-0.94-bin-jdk1.4.tar.gz && \
tar xzf fop-0.94-bin-jdk1.4.tar.gz && \
rm fop-0.94-bin-jdk1.4.tar.gz

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Boost Docker Development Environment for Big Endian
# Boost Docker Development Environment
#

FROM multiarch/fedora:34-ppc64le
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.fedora-34.s390x → Dockerfile.fedora-34-s390x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Boost Docker Development Environment for Big Endian
# Boost Docker Development Environment
#

FROM multiarch/fedora:34-s390x
Expand Down
Loading