Skip to content

Commit 5ef1c98

Browse files
committed
Extract linux build to action
1 parent 1c49d08 commit 5ef1c98

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

.github/workflows/build-package-files.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@ jobs:
2020
fetch-depth: 2
2121
submodules: true
2222

23-
- name: "Install PHP"
24-
uses: "shivammathur/setup-php@v2"
23+
- name: "Build Driver"
24+
uses: ./.github/workflows/linux/build
2525
with:
26-
php-version: 8.3
27-
28-
- name: "Configure driver"
29-
run: .github/workflows/configure.sh
30-
31-
- name: "Build driver"
32-
run: "make all"
26+
version: "8.3"
3327

3428
# TODO: create changelog from tag description
3529
- name: "Add dummy changelog"
@@ -42,6 +36,8 @@ jobs:
4236
- name: "Build release archive"
4337
run: "make package"
4438

39+
# PECL always uses the version for the package name.
40+
# Read it from the version file and store in env to use when uploading artifacts
4541
- name: "Read current package version"
4642
run: echo "PACKAGE_VERSION=$(./bin/update-release-version.php version)" >> "$GITHUB_ENV"
4743

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Linux Build"
2+
description: "Builds the driver"
3+
inputs:
4+
version:
5+
description: "PHP version to build for"
6+
required: true
7+
runs:
8+
using: composite
9+
steps:
10+
- name: "Install PHP"
11+
uses: "shivammathur/setup-php@v2"
12+
with:
13+
php-version: "${{ inputs.version }}"
14+
15+
- name: "Configure driver"
16+
run: .github/workflows/configure.sh
17+
shell: bash
18+
19+
- name: "Build driver"
20+
run: "make all"
21+
shell: bash

.github/workflows/tests.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,11 @@ jobs:
6363
version: ${{ matrix.mongodb-version }}
6464
topology: ${{ matrix.topology }}
6565

66-
- name: "Install PHP"
67-
uses: "shivammathur/setup-php@v2"
66+
- name: "Build Driver"
67+
id: build-driver
68+
uses: ./.github/workflows/linux/build
6869
with:
69-
php-version: "${{ matrix.php-version }}"
70-
tools: "phpize"
71-
72-
- name: "Configure driver"
73-
run: .github/workflows/configure.sh
74-
75-
- name: "Build driver"
76-
run: "make all"
70+
version: ${{ matrix.php-version }}
7771

7872
- name: "Run Tests"
7973
run: TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test

0 commit comments

Comments
 (0)