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

Re-enable ccache #78

Closed
wants to merge 1 commit into from
Closed
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
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:

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.
Expand All @@ -49,8 +50,24 @@ jobs:
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: Cache ccache-${{ matrix.cfg.id }}
id: cache-ccache
uses: actions/cache@v3
with:
path: ccache-${{ matrix.cfg.id }}
key: ccache-${{ matrix.cfg.id }}-${{ hashFiles('**/*.cpp', '**/*.h', '**/meson.build', 'subprojects/*.wrap') }}
restore-keys: ccache-${{ matrix.cfg.id }}-
- name: Inject ccache into docker
uses: reproducible-containers/[email protected]
with:
cache-source: ccache-${{ matrix.cfg.id }}
cache-target: /ccache
skip-extraction: ${{ steps.cache-ccache.outputs.cache-hit }}

- name: Build and push
uses: docker/build-push-action@v5
with:
Expand Down
9 changes: 5 additions & 4 deletions tests/docker/rockylinux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
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 \
python3.11 \
python3-pip \
python3.11-pip \
pkgconf-pkg-config \
ccache \
clang \
Expand All @@ -23,8 +22,9 @@ RUN dnf install -y \
cxxopts-devel
RUN dnf clean all
RUN update-alternatives --install /usr/local/bin/python python /usr/bin/python3.11 10

# Install meson from pip
RUN python3 -m pip install -U meson==0.64.1
RUN python -m pip install -U meson==0.64.1

# Copy code
WORKDIR /workarea
Expand All @@ -38,4 +38,5 @@ ARG setup_options=
ENV CC="ccache $cc" CXX="ccache $cxx"
ENV CCACHE_DIR=/ccache
RUN meson setup builddir $setup_options
RUN --mount=type=cache,target=/ccache/ ninja -C builddir
RUN --mount=type=cache,target=/ccache,sharing=locked \
ninja -C builddir
10 changes: 6 additions & 4 deletions tests/docker/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:22.04

# Install dependencies
RUN apt-get update
RUN apt-get install -y \
RUN apt-get update && \
apt-get install -y \
python3.11 \
python3-pip \
pkg-config \
Expand All @@ -18,8 +18,9 @@ RUN apt-get install -y \
libcxxopts-dev
RUN apt-get clean
RUN update-alternatives --install /usr/local/bin/python python /usr/bin/python3.11 10

# Install meson from pip
RUN python3 -m pip install -U meson==0.64.1
RUN python -m pip install -U meson==0.64.1

# Copy code
WORKDIR /workarea
Expand All @@ -36,4 +37,5 @@ RUN sysctl vm.mmap_rnd_bits=28
ENV CC="ccache $cc" CXX="ccache $cxx"
ENV CCACHE_DIR=/ccache
RUN meson setup builddir $setup_options
RUN --mount=type=cache,target=/ccache/ ninja -C builddir
RUN --mount=type=cache,target=/ccache,sharing=locked \
ninja -C builddir
Loading