Skip to content

Commit

Permalink
Test GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Dec 14, 2020
1 parent 81b4dd4 commit 5608002
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
coverage: xdebug

- name: Install composer dependencies
run: composer install --no-interaction --no-progress --no-suggest
uses: "ramsey/composer-install@v1"

- name: Run PHPUnit
run: vendor/bin/phpunit
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
coverage: xdebug

- name: Install composer dependencies
run: composer install --no-interaction --no-progress --no-suggest
uses: "ramsey/composer-install@v1"

- name: Run PHPUnit with coverage
run: |
Expand Down Expand Up @@ -154,6 +154,32 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Get GEOS & PHP-GEOS from cache
uses: actions/cache@v2
id: cache
with:
path: |
geos
php-geos
key: ${{ runner.os }}-geos-3.8.0-php-geos-1.0.0

- name: Compile GEOS & PHP-GEOS
run: bash ci/install-geos.sh
env:
GEOS_VERSION: 3.8.0
PHP_GEOS_VERSION: 1.0.0
if: steps.cache.outputs.cache-hit != 'true'

- name: Install GEOS & PHP-GEOS
run: |
cd geos
sudo make install
cd ..
cd php-geos
sudo mv modules/geos.so "$(php-config --extension-dir)"
sudo bash -c "echo extension=geos.so > \"$(php-config --ini-dir)/geos.ini\""
cd ..
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -163,18 +189,15 @@ jobs:
- name: Install GEOS
run: bash ci/install-geos.sh

- name: Setup Debug Session
uses: csexton/debugger-action@master

- name: Install composer dependencies
run: composer install --no-interaction --no-progress --no-suggest
uses: "ramsey/composer-install@v1"

- name: Run PHPUnit with coverage
run: |
mkdir -p mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
ENGINE: SQLite3
ENGINE: GEOS

- name: Upload coverage report to Coveralls
run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
Expand Down
10 changes: 4 additions & 6 deletions ci/install-geos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@ sudo apt autoremove

wget https://github.com/libgeos/geos/archive/$GEOS_VERSION.tar.gz
tar zxf $GEOS_VERSION.tar.gz
cd geos-$GEOS_VERSION
mv geos-$GEOS_VERSION geos
cd geos
./autogen.sh
./configure --prefix=/usr
make
sudo make install
cd ..

wget https://github.com/libgeos/php-geos/archive/$PHP_GEOS_VERSION.tar.gz
tar zxf $PHP_GEOS_VERSION.tar.gz
cd php-geos-$PHP_GEOS_VERSION
mv php-geos-$PHP_GEOS_VERSION php-geos
cd php-geos
./autogen.sh
./configure
make
sudo mv modules/geos.so $(php-config --extension-dir)
cd ..

echo "extension=geos.so" > geos.ini

0 comments on commit 5608002

Please sign in to comment.