Skip to content
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
20 changes: 10 additions & 10 deletions .github/actions/run-in-docker-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ inputs:
dockerfile:
description: 'A Dockerfile that defines an image'
required: true
tag:
description: 'A tag of an image'
required: true
scope:
description: 'A cached image scope'
required: false
default: ${{ runner.arch }}
command:
description: 'A command to run in a container'
required: false
Expand All @@ -16,25 +17,23 @@ runs:
steps:
- uses: docker/setup-buildx-action@v3

- uses: docker/build-push-action@v5
- uses: docker/build-push-action@v6
id: main_builder
continue-on-error: true
with:
context: .
file: ${{ inputs.dockerfile }}
tags: ${{ inputs.tag }}
load: true
cache-from: type=gha
cache-from: type=gha,scope=${{ inputs.scope }}

- uses: docker/build-push-action@v5
- uses: docker/build-push-action@v6
id: retry_builder
if: steps.main_builder.outcome == 'failure'
with:
context: .
file: ${{ inputs.dockerfile }}
tags: ${{ inputs.tag }}
load: true
cache-from: type=gha
cache-from: type=gha,scope=${{ inputs.scope }}

- # Workaround for https://github.com/google/sanitizers/issues/1614 .
# The underlying issue has been fixed in clang 18.1.3.
Expand All @@ -47,7 +46,8 @@ runs:
$(echo '${{ toJSON(env) }}' | jq -r 'keys[] | "--env \(.) "') \
--volume ${{ github.workspace }}:${{ github.workspace }} \
--workdir ${{ github.workspace }} \
${{ inputs.tag }} bash -c "
$(docker images -q | head -n1) \
bash -c "
git config --global --add safe.directory ${{ github.workspace }}
${{ inputs.command }}
"
Expand Down
37 changes: 9 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ jobs:
network=host

- name: Build container
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: ./ci/linux-debian.Dockerfile
tags: ${{ matrix.arch }}-debian-image
cache-from: type=gha
cache-to: type=gha,mode=min
cache-from: type=gha,scope=${{ runner.arch }}
cache-to: type=gha,scope=${{ runner.arch }},mode=min

x86_64-debian:
name: "x86_64: Linux (Debian stable)"
Expand Down Expand Up @@ -116,7 +115,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -152,7 +150,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -184,7 +181,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -225,7 +221,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -265,7 +260,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: arm64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -297,7 +291,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand All @@ -313,28 +306,22 @@ jobs:
fail-fast: false
matrix:
include:
- docker_arch: x64
runner: ubuntu-latest
- runner: ubuntu-latest
binary_arch: x64
env_vars: { CC: 'clang', ASM: 'auto' }
- docker_arch: x64
runner: ubuntu-latest
- runner: ubuntu-latest
binary_arch: i686
env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' }
- docker_arch: arm64
runner: ubuntu-24.04-arm
- runner: ubuntu-24.04-arm
binary_arch: arm64
env_vars: { CC: 'clang', ASM: 'auto' }
- docker_arch: x64
runner: ubuntu-latest
- runner: ubuntu-latest
binary_arch: x64
env_vars: { CC: 'clang', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 }
- docker_arch: x64
runner: ubuntu-latest
- runner: ubuntu-latest
binary_arch: i686
env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 }
- docker_arch: arm64
runner: ubuntu-24.04-arm
- runner: ubuntu-24.04-arm
binary_arch: arm64
env_vars: { CC: 'clang', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 }

Expand All @@ -360,7 +347,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: ${{ matrix.docker_arch }}-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -404,7 +390,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -455,7 +440,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -498,7 +482,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand Down Expand Up @@ -714,7 +697,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image

- name: Print logs
uses: ./.github/actions/print-logs
Expand All @@ -733,7 +715,6 @@ jobs:
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: x64-debian-image
command: |
g++ -Werror include/*.h
clang -Werror -x c++-header include/*.h
Expand Down
11 changes: 6 additions & 5 deletions ci/linux-debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN dpkg --add-architecture i386 && \

# dpkg-dev: to make pkg-config work in cross-builds
# llvm: for llvm-symbolizer, which is used by clang's UBSan for symbolized stack traces
RUN apt-get update && apt-get install --no-install-recommends -y \
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
git ca-certificates \
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
gcc clang llvm libclang-rt-dev libc6-dbg \
Expand All @@ -34,14 +34,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
gcc-mingw-w64-i686-win32 wine32 \
python3-full && \
if ! ( dpkg --print-architecture | grep --quiet "arm64" ) ; then \
apt-get install --no-install-recommends -y \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dbg:arm64 ;\
fi && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Build and install gcc snapshot
ARG GCC_SNAPSHOT_MAJOR=16
RUN apt-get update && apt-get install --no-install-recommends -y wget libgmp-dev libmpfr-dev libmpc-dev flex && \
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
wget libgmp-dev libmpfr-dev libmpc-dev flex && \
mkdir gcc && cd gcc && \
wget --progress=dot:giga --https-only --recursive --accept '*.tar.xz' --level 1 --no-directories "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}" && \
wget "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}/sha512.sum" && \
Expand All @@ -62,15 +63,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y wget libgmp-dev
# Install clang snapshot, see https://apt.llvm.org/
RUN \
# Setup GPG keys of LLVM repository
apt-get update && apt-get install --no-install-recommends -y wget && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y wget && \
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
# Add repository for this Debian release
. /etc/os-release && echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" >> /etc/apt/sources.list && \
apt-get update && \
# Determine the version number of the LLVM development branch
LLVM_VERSION=$(apt-cache search --names-only '^clang-[0-9]+$' | sort -V | tail -1 | cut -f1 -d" " | cut -f2 -d"-" ) && \
# Install
apt-get install --no-install-recommends -y "clang-${LLVM_VERSION}" && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y "clang-${LLVM_VERSION}" && \
# Create symlink
ln -s "/usr/bin/clang-${LLVM_VERSION}" /usr/bin/clang-snapshot && \
# Clean up
Expand Down