Skip to content

Commit 87ca792

Browse files
committed
Add GitHub Action workflow for tests
1 parent d5b11f4 commit 87ca792

File tree

3 files changed

+79
-2
lines changed

3 files changed

+79
-2
lines changed

.evergreen/compile-unix.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ echo "PHP_VERSION: $PHP_VERSION"
6666
OLD_PATH=$PATH
6767
PATH=/opt/php/${PHP_VERSION}-64bit/bin:$OLD_PATH
6868

69-
#cat `which phpize` | sed 's@/data/mci/.*/src@/opt@' > ./phpize
70-
#chmod +x ./phpize
7169
phpize
7270
./configure --enable-mongodb-developer-flags
7371
make

.github/workflows/configure.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
CONFIGURE_OPTS="${CONFIGURE_OPTS} --enable-mongodb-developer-flags --enable-mongodb-coverage"
4+
5+
if [ -n "${SSL_VERSION}" ]; then
6+
CONFIGURE_OPTS="${CONFIGURE_OPTS} --with-mongodb-ssl=${SSL_VERSION}"
7+
fi
8+
9+
phpize
10+
./configure ${CONFIGURE_OPTS}

.github/workflows/tests.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Tests"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "v*.*"
7+
- "master"
8+
push:
9+
branches:
10+
- "v*.*"
11+
- "master"
12+
13+
jobs:
14+
tests:
15+
name: "Tests"
16+
runs-on: "${{ matrix.os }}"
17+
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
os:
22+
- "ubuntu-20.04"
23+
php-version:
24+
- "7.4"
25+
- "8.0"
26+
mongodb-version:
27+
- "4.4"
28+
topology:
29+
- "server"
30+
include:
31+
- os: "ubuntu-20.04"
32+
php-version: "8.0"
33+
mongodb-version: "4.4"
34+
topology: "replica_set"
35+
- os: "ubuntu-20.04"
36+
php-version: "8.0"
37+
mongodb-version: "4.4"
38+
topology: "sharded_cluster"
39+
40+
steps:
41+
- name: "Checkout"
42+
uses: "actions/checkout@v2"
43+
with:
44+
fetch-depth: 2
45+
submodules: true
46+
47+
- id: setup-mongodb
48+
uses: mongodb-labs/drivers-evergreen-tools@master
49+
with:
50+
version: ${{ matrix.mongodb-version }}
51+
topology: ${{ matrix.topology }}
52+
53+
- name: "Install PHP"
54+
uses: "shivammathur/setup-php@v2"
55+
with:
56+
php-version: "${{ matrix.php-version }}"
57+
extensions: ":mongodb"
58+
tools: "phpize"
59+
60+
- name: "Configure driver"
61+
run: .github/workflows/configure.sh
62+
63+
- name: "Build driver"
64+
run: "make all"
65+
66+
- name: "Run Tests"
67+
run: TEST_PHP_ARGS="-q -x --show-diff -g FAIL,BORK,WARN,LEAK,SKIP" make test
68+
env:
69+
MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}

0 commit comments

Comments
 (0)