Skip to content
Open
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
19 changes: 8 additions & 11 deletions .github/actions/run-in-docker-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ description: 'Run a command in a Docker container, while passing explicitly set
inputs:
dockerfile:
description: 'A Dockerfile that defines an image'
required: true
tag:
description: 'A tag of an image'
required: true
required: false
default: ./ci/linux-debian.Dockerfile
command:
description: 'A command to run in a container'
required: false
Expand All @@ -16,25 +14,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=${{ runner.arch }}

- 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=${{ runner.arch }}

- # Workaround for https://github.com/google/sanitizers/issues/1614 .
# The underlying issue has been fixed in clang 18.1.3.
Expand All @@ -47,7 +43,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
60 changes: 9 additions & 51 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 @@ -114,9 +113,6 @@ jobs:
- name: CI script
env: ${{ matrix.configuration.env_vars }}
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 @@ -150,9 +146,6 @@ jobs:

- name: CI script
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 @@ -182,9 +175,6 @@ jobs:

- name: CI script
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 @@ -223,9 +213,6 @@ jobs:
- name: CI script
env: ${{ matrix.configuration.env_vars }}
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 @@ -263,9 +250,6 @@ jobs:

- name: CI script
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 @@ -295,9 +279,6 @@ jobs:

- name: CI script
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 +294,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 @@ -358,9 +333,6 @@ jobs:
- name: CI script
env: ${{ matrix.env_vars }}
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 @@ -402,9 +374,6 @@ jobs:
- name: CI script
env: ${{ matrix.configuration.env_vars }}
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 @@ -453,9 +422,6 @@ jobs:
- name: CI script
env: ${{ matrix.configuration.env_vars }}
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 @@ -496,9 +462,6 @@ jobs:
- name: CI script
env: ${{ matrix.configuration.env_vars }}
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 @@ -712,9 +675,6 @@ jobs:

- name: CI script
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 @@ -732,8 +692,6 @@ jobs:
- name: CI script
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
2 changes: 2 additions & 0 deletions ci/linux-debian.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM debian:stable-slim

ENV DEBIAN_FRONTEND=noninteractive

SHELL ["/bin/bash", "-c"]

WORKDIR /root
Expand Down