diff --git a/.ci/docker/rockylinux.Dockerfile b/.ci/docker/rockylinux.Dockerfile deleted file mode 100644 index 17823a3..0000000 --- a/.ci/docker/rockylinux.Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -FROM rockylinux:9 - -# Enable EPEL. -RUN dnf update -y -RUN dnf install -y 'dnf-command(config-manager)' -RUN dnf config-manager --set-enabled crb -y -RUN dnf install epel-release -y - -# Install dependencies. -RUN dnf install -y \ - clang \ - g++ \ - ninja-build \ - cmake \ - git -RUN dnf clean all - -# Copy code. -WORKDIR /workarea -COPY ./ ./ - -# Set build arguments. -ARG cc=gcc -ARG cxx=g++ -ARG cmake_args= - -# Build. -ENV CC="$cc" CXX="$cxx" CMAKE_GENERATOR="Ninja" CMAKE_EXPORT_COMPILE_COMMANDS=on -RUN cmake -B build -S . "$cmake_args" -RUN cmake --build build --verbose -RUN cmake --install build --prefix /opt/beman.dump -RUN find /opt/beman.dump -type f - diff --git a/.ci/docker/ubuntu.Dockerfile b/.ci/docker/ubuntu.Dockerfile deleted file mode 100644 index cfb3c81..0000000 --- a/.ci/docker/ubuntu.Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -# Using a non-LTS Ubuntu, just until CMake 3.23 is available on Ubuntu 24.04. -FROM ubuntu:23.10 - -# Install dependencies, -RUN apt-get update -RUN apt-get install -y \ - clang \ - clang-tidy \ - g++ \ - ninja-build \ - cmake \ - git -RUN apt-get clean - -WORKDIR /workarea -COPY ./ ./ - -# Set build arguments. -ARG cc=gcc -ARG cxx=g++ -ARG cmake_args= - -# Workaround Ubuntu broken ASan -RUN sysctl vm.mmap_rnd_bits=28 - -# Build. -ENV CC="$cc" CXX="$cxx" CMAKE_GENERATOR="Ninja" CMAKE_EXPORT_COMPILE_COMMANDS=on -RUN ls -lR src -RUN cmake -B build -S . "$cmake_args" -RUN cmake --build build --verbose -RUN cmake --install build --prefix /opt/beman.example -RUN find /opt/beman.example -type f diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 0f3c8cc..a32156f 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -21,50 +21,28 @@ on: jobs: test: - runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - cfg: - - { id: ubuntu-gcc-static-cxx23, platform: ubuntu, cc: gcc, cpp: g++, cmake_args: "-DCMAKE_CXX_STANDARD=23 -DCMAKE_CXX_STANDARD_REQUIRED=on"} - - { id: ubuntu-gcc-static-cxx26, platform: ubuntu, cc: gcc, cpp: g++, cmake_args: "-DCMAKE_CXX_STANDARD=26 -DCMAKE_CXX_STANDARD_REQUIRED=on"} - - { id: ubuntu-clang-static-cxx23, platform: ubuntu, cc: clang, cpp: clang++, cmake_args: "-DCMAKE_CXX_STANDARD=23 -DCMAKE_CXX_STANDARD_REQUIRED=on"} - - { id: ubuntu-clang-static-cxx26, platform: ubuntu, cc: clang, cpp: clang++, cmake_args: "-DCMAKE_CXX_STANDARD=26 -DCMAKE_CXX_STANDARD_REQUIRED=on"} + image: + - "gcc:14" + build_type: [Debug, Release] + + runs-on: ubuntu-latest + container: + image: ghcr.io/foonathan/${{matrix.image}} steps: - - uses: actions/checkout@v2 - # GitHub runners have updated the Ubuntu Linux Kernel to use strong ASLR, - # but LLVM is not configured for this change, and thus the address - # sanitizer breaks. - # - # The next image is supposed to fix this, so if the Ubuntu image has been - # updated, this work around is no longer required. - - name: get runner image version - id: runner-image-version - run: | - echo "image-version=$(echo $ImageVersion)" >> "$GITHUB_OUTPUT" - working-directory: . - - name: modify number of bits to use for ASLR entropy - if: ${{ steps.runner-image-version.outputs.ImageVersion }} == '20240310.1.0' - run: | - sudo sysctl -a | grep vm.mmap.rnd - sudo sysctl -w vm.mmap_rnd_bits=28 - working-directory: . - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: false - load: true - tags: ${{ matrix.cfg.id }} - file: .ci/docker/${{ matrix.cfg.platform }}.Dockerfile - build-args: | - cc=${{ matrix.cfg.cc }} - cxx=${{ matrix.cfg.cpp }} - cmake_args=${{ matrix.cfg.cmake_args }} - cache-from: type=gha - cache-to: type=gha,mode=max - - name: Run tests - run: | - docker run ${{ matrix.cfg.id }} ctest --test-dir build + - uses: actions/checkout@v4 + - name: Create Build Environment + run: cmake -E make_directory build + + - name: Configure + working-directory: build/ + run: cmake -GNinja $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra" + - name: Build + working-directory: build/ + run: cmake --build . + - name: Test + working-directory: build/ + run: ctest --output-on-failure