From 5608002dec97c5b03696b6c936f74702bf5617de Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Mon, 14 Dec 2020 11:19:24 +0100 Subject: [PATCH] Test GitHub Actions --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++------- ci/install-geos.sh | 10 ++++------ 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8c55a78..94a51d40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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: | @@ -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: @@ -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 diff --git a/ci/install-geos.sh b/ci/install-geos.sh index 2a7468c5..d723b440 100644 --- a/ci/install-geos.sh +++ b/ci/install-geos.sh @@ -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