Skip to content

Commit 5be5fc9

Browse files
committed
Added GHA
1 parent 518bfc1 commit 5be5fc9

File tree

4 files changed

+64
-25
lines changed

4 files changed

+64
-25
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
name: Build and test
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php: [7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: "${{ matrix.php }}"
26+
coverage: none
27+
ini-values: "session.save_path=/tmp"
28+
extensions: json
29+
tools: pecl
30+
31+
- name: Compile
32+
run: ./.github/workflows/compile.sh
33+
34+
- name: Run tests
35+
run: |
36+
php -m
37+
php --rf "json_decode"
38+
export TEST_PHP_EXECUTABLE=`which php`
39+
php run-tests.php -d extension=`pwd`/modules/geospatial.so && if ls tests/*.diff >/dev/null 2>&1; then echo "Tests failed" && cat tests/*.diff && exit 1; fi
40+
41+
- name: Show errors
42+
if: ${{ failure() }}
43+
run: ./.github/workflows/show-errors.sh
44+
45+
- name: Do GCOV
46+
if: ${{ failure() }}
47+
run: |
48+
gcov --object-directory .libs *.c
49+
bash <(curl -s https://codecov.io/bash)

.github/workflows/compile.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
phpize
4+
EXTRA_LDFLAGS="-precious-files-regex .libs/geospatial.gcno" LDFLAGS="-lgcov" CFLAGS="-Wall -ggdb3 -fno-strict-aliasing -coverage -O0" ./configure --enable-geospatial
5+
make

.github/workflows/show-errors.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
for i in tests/*.diff tests/*.sh; do
4+
echo "=========================================================================="
5+
echo $i
6+
echo "--------------------------------------------------------------------------"
7+
cat $i
8+
echo "=========================================================================="
9+
echo
10+
done

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)