Skip to content

Commit bbafd7c

Browse files
authored
Merge pull request #110 from maxmind/greg/github-actions
Switch to GitHub Actions
2 parents 09e8c48 + 6eb9a35 commit bbafd7c

6 files changed

Lines changed: 82 additions & 108 deletions

File tree

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PHP Lints
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
name: "PHP Lints"
9+
steps:
10+
- name: Setup PHP
11+
uses: shivammathur/setup-php@v2
12+
with:
13+
php-version: 7.4
14+
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Install dependencies
19+
run: composer install --no-progress --prefer-dist --optimize-autoloader
20+
21+
- name: Lint with php-cs-fixer
22+
run: vendor/bin/php-cs-fixer fix --verbose --diff --dry-run --config=.php_cs
23+
24+
- name: Lint with phpcs
25+
run: vendor/bin/phpcs --standard=.phpcs-ruleset.xml src/

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: PHPUnit
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
run:
7+
runs-on: ${{ matrix.operating-system }}
8+
strategy:
9+
matrix:
10+
operating-system: [ubuntu-latest]
11+
php-versions: ['7.2', '7.3', '7.4']
12+
name: "PHP ${{ matrix.php-versions }} test on ${{ matrix.operating-system }}"
13+
steps:
14+
- name: Setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: ${{ matrix.php-versions }}
18+
tools: composer, phpize
19+
20+
- name: Setup problem matchers for PHPUnit
21+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
22+
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
with:
26+
submodules: true
27+
28+
- name: Install libmaxminddb
29+
run: |
30+
mkdir -p "$HOME/libmaxminddb"
31+
git clone --recursive git://github.com/maxmind/libmaxminddb
32+
cd libmaxminddb
33+
./bootstrap
34+
./configure --prefix="$HOME/libmaxminddb"
35+
make
36+
make install
37+
38+
- name: Build extension
39+
run: |
40+
export CFLAGS="-L$HOME/libmaxminddb/lib"
41+
export CPPFLAGS="-I$HOME/libmaxminddb/include"
42+
cd ext
43+
phpize
44+
./configure --with-maxminddb --enable-maxminddb-debug
45+
make clean
46+
make
47+
NO_INTERACTION=1 make test
48+
cd ..
49+
50+
- name: Install dependencies
51+
run: composer install --no-progress --prefer-dist --optimize-autoloader
52+
53+
- name: Test with phpunit without extension
54+
run: vendor/bin/phpunit --coverage-text
55+
56+
- name: Test with phpunit using extension
57+
run: php -d extension=ext/modules/maxminddb.so vendor/bin/phpunit

.travis-build.sh

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

.travis-install-prereqs.sh

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

.travis-test.sh

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

.travis.yml

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

0 commit comments

Comments
 (0)