Skip to content
47 changes: 20 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.5']
php: ['8.5']
postgres: ['16', '17', '18']

services:
Expand All @@ -28,7 +28,7 @@ jobs:
ports:
- 5432/tcp
env:
POSTGRES_USER: yourls
POSTGRES_USER: root
POSTGRES_PASSWORD: secret
POSTGRES_DB: yourls_tests
options: >-
Expand All @@ -38,50 +38,43 @@ jobs:
--health-retries=5

steps:
- name: Checkout yourls-postgresql
uses: actions/checkout@v6
with:
path: yourls-postgresql

- name: Checkout YOURLS master
uses: actions/checkout@v6
with:
repository: YOURLS/YOURLS
ref: master
path: yourls

- name: Checkout yourls-postgresql
uses: actions/checkout@v6
with:
path: yourls-postgresql

- name: Use PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@2.37.1
with:
php-version: ${{ matrix.php }}
extensions: mbstring, curl, zip, dom, simplexml, intl, pdo_pgsql
tools: phpunit
coverage: none

- name: Prepare YOURLS test environment
working-directory: yourls
run: |
git clone https://github.com/ozh/YOURLS-fr_FR.git user/languages/fr
cp user/languages/fr/fr_FR.* user/languages
cp tests/data/config/yourls-tests-config-ci.php user/config.php

- name: Drop in db.php
run: cp yourls-postgresql/db.php yourls/user/db.php
- name: User PostgreSQL DB engine
run: mv yourls-postgresql/db.php user/db.php

- name: Run YOURLS test suite
working-directory: yourls
run: >-
phpunit
--configuration phpunit.xml.dist
--display-skipped
--display-incomplete
--display-deprecations
--display-notices
--display-warnings
--display-errors
run: |
ls -L user/db.php
phpunit \
--configuration phpunit.xml.dist \
--display-skipped \
--display-incomplete \
--display-deprecations \
--display-notices \
--display-warnings \
--display-errors
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
DB_USER: yourls
DB_PASSWORD: secret
DB_NAME: yourls_tests