Skip to content

Adjusted github actions file #42

Adjusted github actions file

Adjusted github actions file #42

Workflow file for this run

name: Codeception tests
on: [ push ]
jobs:
build:
name: ${{matrix.operating-system}}, PHP ${{ matrix.php }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, ubuntu-22.04 ]
php: [ '8.0', '8.1','8.2','8.3','8.4' ]
services:
postgres:
image: postgres
env:
POSTGRES_DB: kodus_db_cache_test
POSTGRES_USER: root
POSTGRES_PASSWORD: root
ports:
- 5432:5432
mysql:
image: mysql
env:
MYSQL_DATABASE: kodus_db_cache_test
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: Install dependencies
run: composer install
- name: Verify Installed PHP Extensions
run: php -m
- name: Sleep for 10 seconds - wait for MySQL to start
run: sleep 10
- name: Test MySQL Connection
run: |
php -r "
try {
new PDO('mysql:host=127.0.0.1;port=3306;dbname=kodus_db_cache_test', 'root', 'root');
echo 'Connection successful';
} catch (PDOException \$e) {
echo 'Connection failed: ' . \$e->getMessage();
}"
- name: Run tests
run: php vendor/bin/phpunit