Skip to content

Merge branch 'master' into with_tests #16

Merge branch 'master' into with_tests

Merge branch 'master' into with_tests #16

name: php-simple-build
on:
push:
paths:
- 'php-simple/**'
- '.github/workflows/php-simple-build.yml'
pull_request:
paths:
- 'php-simple/**'
- '.github/workflows/php-simple-build.yml'
jobs:
build:
defaults:
run:
working-directory: ./php-simple
runs-on: ubuntu-latest
env:
DB_USER: root
DB_OLD_PASSWORD: root
DB_PASSWORD: mysql
strategy:
matrix:
php-version: ["7.3", "8.0", "8.2"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Start MYSQL and import DB
run: |
sudo systemctl start mysql
mysqladmin --user=${{ env.DB_USER }} --password=${{ env.DB_OLD_PASSWORD }} password ${{ env.DB_PASSWORD }}
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < ${GITHUB_WORKSPACE}/database/initDatabase.sql
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Set up dependencies
run: composer update
- name: Test
run: ./vendor/bin/phpunit