Skip to content

Commit 45dc641

Browse files
committed
Add build action to build libmongoc system libraries
1 parent b5f3c8e commit 45dc641

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Build libmongoc"
2+
description: "Builds and install libmongoc"
3+
inputs:
4+
prefix:
5+
description: "Prefix to install libmongoc to"
6+
default: "/usr/local"
7+
version:
8+
description: "Libmongoc version to build"
9+
required: true
10+
runs:
11+
using: composite
12+
13+
steps:
14+
- name: Download libmongoc
15+
shell: bash
16+
working-directory: /tmp
17+
run: wget "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/${LIBMONGOC_VERSION}.tar.gz" --output-document="mongo-c-driver.tar.gz"
18+
env:
19+
LIBMONGOC_VERSION: ${{ inputs.version }}
20+
21+
- name: Extract libmongoc
22+
shell: bash
23+
working-directory: /tmp
24+
run: tar xf "mongo-c-driver.tar.gz"
25+
26+
- name: Configure cmake
27+
shell: bash
28+
working-directory: /tmp
29+
run: |
30+
cmake \
31+
-S "mongo-c-driver-${LIBMONGOC_VERSION}" \
32+
-B _build \
33+
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
34+
-D BUILD_VERSION="${LIBMONGOC_VERSION}" \
35+
-D ENABLE_MONGOC=ON \
36+
-D ENABLE_TRACING=ON
37+
env:
38+
LIBMONGOC_VERSION: ${{ inputs.version }}
39+
40+
- name: Build libmongoc
41+
shell: bash
42+
working-directory: /tmp
43+
run: cmake --build _build --config RelWithDebInfo --parallel
44+
45+
- name: Install libmongoc
46+
shell: bash
47+
working-directory: /tmp
48+
run: sudo cmake --install _build --prefix "${PREFIX}" --config RelWithDebInfo
49+
env:
50+
PREFIX: ${{ inputs.prefix }}
51+
52+
- name: Check pkg-config availability
53+
shell: bash
54+
run: pkg-config --modversion mongoc2

.github/workflows/system-libs.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "System library tests"
2+
3+
on:
4+
push:
5+
branches:
6+
- "build-system-libs"
7+
8+
jobs:
9+
tests:
10+
name: "Build"
11+
runs-on: "ubuntu-24.04"
12+
13+
steps:
14+
- name: "Checkout"
15+
uses: "actions/checkout@v4"
16+
with:
17+
submodules: true
18+
19+
- name: "Build libmongoc"
20+
id: build-libmongoc
21+
uses: ./.github/actions/linux/build-libmongoc
22+
with:
23+
version: 2.0.1

0 commit comments

Comments
 (0)