Skip to content

Merge pull request #77 from kiwilan/develop #598

Merge pull request #77 from kiwilan/develop

Merge pull request #77 from kiwilan/develop #598

Workflow file for this run

name: Tests on unix
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.2, 8.3]
node: [18]
stability: [prefer-stable]
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: testing
MYSQL_PASSWORD: testing
MYSQL_DATABASE: testing
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
mariadb:
image: mariadb:11.4
ports:
- 3307:3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
env:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: testing
MARIADB_USER: testing
MARIADB_PASSWORD: testing
pgsql:
image: postgres:16.3
env:
POSTGRES_USER: testing
POSTGRES_PASSWORD: testing
POSTGRES_DB: testing
ports:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: 12345OHdf%e
ports:
- 1433:1433
mongodb:
image: mongo:7.0.12
env:
MONGO_INITDB_ROOT_USERNAME: testing
MONGO_INITDB_ROOT_PASSWORD: testing
MONGO_INITDB_DATABASE: admin
ports:
- 27017:27017
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
steps:
- name: Checkout code
# https://github.com/actions/checkout
uses: actions/checkout@v4
- name: Verify MySQL connection from host
run: |
sudo apt-get install -y mysql-client
mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SHOW DATABASES"
- name: Setup PHP
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo
coverage: pcov
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Create dotenv file
run: cp .env.example .env
- name: Setup node
# https://github.com/actions/setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install pnpm
run: npm install -g pnpm
- name: Install node dependencies
run: pnpm install
- name: Execute tests
run: vendor/bin/pest --coverage
- name: Send code coverage
# https://github.com/codecov/codecov-action
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: false