Skip to content

Commit 09a412b

Browse files
committed
Extract build to action
1 parent 46bf763 commit 09a412b

File tree

2 files changed

+55
-34
lines changed

2 files changed

+55
-34
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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: cmake -S "mongo-c-driver-${LIBMONGOC_VERSION}" -B _build \
30+
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
31+
-D BUILD_VERSION="${LIBMONGOC_VERSION}" \
32+
-D ENABLE_MONGOC=ON
33+
env:
34+
LIBMONGOC_VERSION: ${{ inputs.version }}
35+
36+
- name: Build libmongoc
37+
shell: bash
38+
working-directory: /tmp
39+
run: cmake --build _build --config RelWithDebInfo --parallel
40+
41+
- name: Install libmongoc
42+
shell: bash
43+
working-directory: /tmp
44+
run: sudo cmake --install _build --prefix "${PREFIX}" --config RelWithDebInfo
45+
env:
46+
PREFIX: ${{ inputs.prefix }}
47+
48+
- name: Check pkg-config availability
49+
shell: bash
50+
run: pkg-config --modversion mongoc2

.github/workflows/system-libs.yml

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- "build-system-libs"
77

8-
env:
9-
LIBMONGOC_VERSION: "2.0.1"
10-
118
jobs:
129
tests:
1310
name: "Build"
@@ -19,34 +16,8 @@ jobs:
1916
with:
2017
submodules: true
2118

22-
- name: Download libmongoc
23-
shell: bash
24-
working-directory: /tmp
25-
run: wget "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/${LIBMONGOC_VERSION}.tar.gz" --output-document="mongo-c-driver.tar.gz"
26-
27-
- name: Extract libmongoc
28-
shell: bash
29-
working-directory: /tmp
30-
run: tar xf "mongo-c-driver.tar.gz"
31-
32-
- name: Configure cmake
33-
shell: bash
34-
working-directory: /tmp
35-
run: cmake -S "mongo-c-driver-${LIBMONGOC_VERSION}" -B _build \
36-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
37-
-D BUILD_VERSION="${LIBMONGOC_VERSION}" \
38-
-D ENABLE_MONGOC=ON
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 "/usr/local" --config RelWithDebInfo
49-
50-
- name: Check pkg-config availability
51-
shell: bash
52-
run: pkg-config --modversion mongoc2
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)