Skip to content

Commit 515d350

Browse files
committed
Test with multiple Ubuntu versions
1 parent c730109 commit 515d350

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

.github/workflows/vcpkg_docker.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ concurrency:
2323

2424
env:
2525
# Also remember to change the 'docker/build.sh' script
26-
REGISTRY_IMAGE: "ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu-22.04-v2"
26+
# NOTE: Setting the environment variable here isn't ideal because we
27+
# can't use any matrix variables here, and in the future we will probably
28+
# want to support building multiple Ubuntu versions
29+
REGISTRY_IMAGE_ROOT: "ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu"
2730

2831
jobs:
2932
build:
@@ -34,6 +37,11 @@ jobs:
3437
platform:
3538
- linux/amd64
3639
- linux/arm64
40+
ubuntu_version:
41+
- 22.04
42+
- 24.04
43+
env:
44+
REGISTRY_IMAGE: ${{ env.REGISTRY_IMAGE_ROOT }}-${{ matrix.ubuntu_version }}
3745
steps:
3846
- name: Prepare
3947
run: |
@@ -71,17 +79,17 @@ jobs:
7179
platforms: ${{ matrix.platform }}
7280
labels: ${{ steps.meta.outputs.labels }}
7381
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
74-
-
75-
name: Export digest
82+
83+
- name: Export digest
7684
run: |
7785
mkdir -p /tmp/digests
7886
digest="${{ steps.build.outputs.digest }}"
7987
touch "/tmp/digests/${digest#sha256:}"
80-
-
81-
name: Upload digest
88+
89+
- name: Upload digest
8290
uses: actions/upload-artifact@v4
8391
with:
84-
name: digests-${{ env.PLATFORM_PAIR }}
92+
name: digests-${{ matrix.ubuntu_version }}-${{ env.PLATFORM_PAIR }}
8593
path: /tmp/digests/*
8694
if-no-files-found: error
8795
retention-days: 1
@@ -90,12 +98,20 @@ jobs:
9098
runs-on: ubuntu-latest
9199
needs:
92100
- build
101+
strategy:
102+
fail-fast: false
103+
matrix:
104+
ubuntu_version:
105+
- 22.04
106+
- 24.04
107+
env:
108+
REGISTRY_IMAGE: ${{ env.REGISTRY_IMAGE_ROOT }}-${{ matrix.ubuntu_version }}
93109
steps:
94110
- name: Download digests
95111
uses: actions/download-artifact@v4
96112
with:
97113
path: /tmp/digests
98-
pattern: digests-*
114+
pattern: digests-${{ matrix.ubuntu_version }}-*
99115
merge-multiple: true
100116

101117
- name: Set up Docker Buildx

docker/Dockerfile.ubuntu.vcpkg

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ ARG UBUNTU_VERSION=22.04
22
ARG LLVM_VERSION=16
33

44
FROM ubuntu:${UBUNTU_VERSION} as base
5+
ARG UBUNTU_VERSION
56
ARG LLVM_VERSION
67

78
# All build dependencies for vcpkg packages
@@ -13,16 +14,18 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
1314
apt-get update && apt-get install --yes apt-utils && apt-get upgrade --yes && \
1415
apt-get install --yes --no-install-recommends apt-transport-https software-properties-common gnupg ca-certificates wget && \
1516
apt-add-repository ppa:git-core/ppa --yes && \
16-
wget "https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-$(uname -m).sh" && \
17+
wget "https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-$(uname -m).sh" && \
1718
/bin/bash cmake-*.sh --skip-license --prefix=/usr/local && rm cmake-*.sh && \
1819
\
19-
wget https://apt.llvm.org/llvm.sh && \
20-
chmod +x llvm.sh && \
21-
./llvm.sh ${LLVM_VERSION} clang lld && \
20+
if [ "${UBUNTU_VERSION}" != "24.04" ] ; then \
21+
wget https://apt.llvm.org/llvm.sh && \
22+
chmod +x llvm.sh && \
23+
./llvm.sh ${LLVM_VERSION} clang lld ; \
24+
fi && \
2225
\
2326
apt-get update && apt-get upgrade --yes && \
2427
apt-get install --yes --no-install-recommends \
25-
libtinfo-dev libzstd-dev python3-pip python3-setuptools python-setuptools \
28+
libtinfo-dev libzstd-dev python3-pip python3-setuptools \
2629
build-essential binutils-multiarch g++ gcc clang lld clang-${LLVM_VERSION} lld-${LLVM_VERSION} ninja-build \
2730
pixz xz-utils make rpm curl unzip tar git zip python3 pkg-config && \
2831
apt-get install --yes --no-install-recommends \
@@ -41,7 +44,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
4144

4245
# Much heavier installation due to mono dependency for NuGet
4346
FROM base as caching
44-
ARG DISTRO_VERSION
4547
RUN export DEBIAN_FRONTEND=noninteractive && \
4648
apt-get update && \
4749
apt-get install --yes mono-devel && \

docker/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ set -euo pipefail
66
# build vcpkg libraries as well as all lifting-bits tools
77

88
# Ubuntu versions to build
9-
UBUNTU_VERSION_MATRIX=( "22.04" )
9+
UBUNTU_VERSION_MATRIX=( "22.04" "24.04" )
1010

1111
for version in "${UBUNTU_VERSION_MATRIX[@]}"; do
1212
# Always pull from upstream
1313
docker pull "ubuntu:${version}"
1414

1515
# Also remember to change the '.github/workflows/vcpkg_docker.yml' variable
1616
# Image identification
17-
tag="vcpkg-builder-ubuntu-${version}-v2"
17+
image="vcpkg-builder-ubuntu-${version}"
1818

1919
# Build
2020
docker build \
2121
-f Dockerfile.ubuntu.vcpkg \
2222
--no-cache \
23-
--build-arg "DISTRO_VERSION=${version}" \
24-
-t "${tag}" \
23+
--build-arg "UBUNTU_VERSION=${version}" \
24+
-t "${image}" \
2525
.
2626
done

0 commit comments

Comments
 (0)