ci: phpunit fix #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHPUnit & Psalm | |
on: [push] | |
permissions: | |
contents: read | |
jobs: | |
phpunit: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: [8.0, 8.1, 8.2, 8.3, 8.4] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: mbstring, pdo, mysql, pgsql | |
ini-values: memory_limit=1G, post_max_size=50M, upload_max_filesize=50M | |
coverage: none | |
- name: Start MySQL | |
uses: mirromutth/mysql-action@v1 | |
with: | |
mysql version: '8.0' | |
root password: 'root' | |
database: 'test_db' | |
user: 'test_user' | |
password: 'test_password' | |
- name: Start PostgreSQL | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y postgresql postgresql-contrib | |
sudo service postgresql start | |
sudo -u postgres psql -c "CREATE USER test_user WITH PASSWORD 'test_password';" | |
sudo -u postgres psql -c "CREATE DATABASE test_db OWNER test_user;" | |
- name: Install dependencies | |
run: | | |
composer config --global process-timeout 2000 | |
composer config --global memory-limit -1 | |
composer install --no-progress --no-suggest --prefer-dist | |
- name: Run PHPUnit tests | |
run: vendor/bin/phpunit --testdox | |
psalm: | |
runs-on: ubuntu-latest | |
env: | |
php-version: '8.0' | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.php-version }} | |
ini-values: "memory_limit=-1" | |
coverage: none | |
- name: Checkout target branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: Checkout PR | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Psalm | |
run: ./vendor/bin/psalm --output-format=github --no-progress |