Skip to content

Commit ce4453a

Browse files
Add an Alpine build job
1 parent 8012a52 commit ce4453a

File tree

2 files changed

+43
-16
lines changed

2 files changed

+43
-16
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@ jobs:
66
name: Check Formatting
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Checkout
9+
- &checkout
10+
name: Checkout
1011
uses: actions/checkout@v4
11-
- name: Get UV
12+
- &get-uv
13+
name: Get UV
1214
uses: astral-sh/setup-uv@v6
1315
with:
1416
version: 0.8.15
1517
- name: Check Formatting
1618
run: make format-check PYTHON_RUN="uv run --group=format"
19+
20+
build-alpine:
21+
name: Build on Alpine 3.20
22+
runs-on: ubuntu-latest
23+
steps:
24+
- *checkout
25+
- name: Run Build
26+
run: bash tools/earthly.sh +build-alpine --use_vcpkg=false

Earthfile

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
VERSION 0.8
22

3+
ARG --global default_container_registry = "docker.io"
4+
5+
build-gcc:
6+
ARG --required gcc_version
7+
FROM $default_container_registry/gcc:$gcc_version
8+
DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
9+
--build_deps "perl pkg-config linux-libc-dev curl zip unzip"
10+
311
build-alpine:
4-
FROM alpine:3.20
12+
FROM $default_container_registry/alpine:3.20
513
DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
614
--build_deps "build-base git cmake gcc g++ ninja make ccache python3" \
715
--vcpkg_bs_deps "pkgconfig linux-headers perl bash tar zip unzip curl" \
816
--third_deps "fmt-dev boost-dev openssl-dev"
917

1018
build-debian:
11-
FROM debian:12
19+
FROM $default_container_registry/debian:12
1220
DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
1321
# Spec test generation requires a Python newer than what is on Debian 12
1422
--BUILD_SPEC_TESTS=FALSE \
@@ -17,7 +25,7 @@ build-debian:
1725
--third_deps "libfmt-dev libboost-url1.81-dev libboost-container1.81-dev libssl-dev"
1826

1927
build-rl:
20-
FROM rockylinux:8
28+
FROM $default_container_registry/rockylinux:8
2129
RUN dnf -y install epel-release unzip
2230
LET cmake_url = "https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3-linux-x86_64.sh"
2331
RUN curl "$cmake_url" -Lo cmake.sh && \
@@ -32,14 +40,14 @@ build-rl:
3240
--vcpkg_bs_deps "zip unzip git perl"
3341

3442
build-fedora:
35-
FROM fedora:41
43+
FROM $default_container_registry/fedora:41
3644
DO --pass-args +BOOTSTRAP_BUILD_INSTALL_EXPORT \
3745
--build_deps "cmake ninja-build git gcc gcc-c++ python3.12 ccache" \
3846
--vcpkg_bs_deps "zip unzip perl" \
3947
--third_deps "boost-devel boost-url fmt-devel openssl-devel"
4048

4149
build-multi:
42-
FROM alpine
50+
FROM $default_container_registry/alpine
4351
# COPY +build-rl/ out/rl/ ## XXX: Redhat build is broken: Investigate GCC linker issues
4452
COPY (+build-debian/ --use_vcpkg=false) out/debian/
4553
COPY (+build-alpine/ --use_vcpkg=false) out/alpine/
@@ -61,6 +69,13 @@ run:
6169
INIT:
6270
FUNCTION
6371
COPY --chmod=755 tools/__install /usr/local/bin/__install
72+
RUN __install curl
73+
ARG uv_version = "0.8.15"
74+
ARG uv_install_sh_url = "https://astral.sh/uv/$uv_version/install.sh"
75+
RUN (curl -LsSf "$uv_install_sh_url" || wget -qO- "$uv_install_sh_url") \
76+
| env UV_UNMANAGED_INSTALL=/opt/uv sh - \
77+
&& ln -s /opt/uv/uv /usr/local/bin/uv \
78+
&& uv --version
6479

6580
BOOTSTRAP_BUILD_INSTALL_EXPORT:
6681
FUNCTION
@@ -110,12 +125,14 @@ BOOTSTRAP_DEPS:
110125
# Running CMake now will prepare our dependencies without configuring the rest of the project
111126
CACHE ~/.cache/vcpkg
112127
ARG launcher
113-
RUN $launcher cmake -S $src_tmp -B $src_tmp/_build/vcpkg-bootstrapping
128+
RUN $launcher uv run --with=cmake~=3.20 --with=ninja cmake -S $src_tmp -B $src_tmp/_build/vcpkg-bootstrapping
114129
END
115130

116131
COPY_SRC:
117132
FUNCTION
118-
COPY --dir CMakeLists.txt vcpkg*.json etc/ src/ tools/ include/ etc/ tests/ .
133+
COPY --dir CMakeLists.txt vcpkg*.json etc/ src/ tools/ include/ etc/ \
134+
tests/ Makefile pyproject.toml uv.lock \
135+
.
119136

120137
BUILD:
121138
FUNCTION
@@ -132,13 +149,13 @@ BUILD:
132149
ARG use_vcpkg=true
133150
LET __use_vcpkg=$(echo "$use_vcpkg" | tr "[:lower:]" "[:upper:]")
134151
# Configure
135-
RUN $launcher cmake -S . -B _build -G "Ninja Multi-Config" \
136-
-D CMAKE_CROSS_CONFIGS="all" \
137-
-D CMAKE_INSTALL_PREFIX=$prefix \
138-
-D AMONGOC_USE_PMM=$__use_vcpkg \
139-
-D BUILD_TESTING=$__test \
140-
-D BUILD_SPEC_TESTS=$BUILD_SPEC_TESTS \
141-
-D CMAKE_DEFAULT_CONFIGS=all
152+
RUN $launcher make test \
153+
LAUNCHER='uv run --group=build' \
154+
CONFIGS="Debug" \
155+
TEST_CONFIG="Debug" \
156+
USE_PMM=$__use_vcpkg \
157+
INSTALL_PREFIX=$prefix \
158+
BUILD_TESTING=$__test
142159
# Build
143160
RUN $launcher cmake --build _build
144161
IF test "$install_prefix" != ""

0 commit comments

Comments
 (0)