mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 18:25:04 +02:00
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: PHP Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
run:
|
|
name: PHP ${{ matrix.php-versions }} Test
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
APP_ENV: test
|
|
SYMFONY_DEPRECATIONS_HELPER: disabled
|
|
DATABASE_URL: 'mysql://root:1234@127.0.0.1:3306/part-db_test'
|
|
|
|
strategy:
|
|
matrix:
|
|
php-versions: ['7.2', '7.3', '7.4']
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
coverage: pcov
|
|
extensions: mbstring, intl, gd, xsl, gmp, bcmath
|
|
|
|
- name: Setup MySQL
|
|
uses: mirromutth/mysql-action@v1.1
|
|
with:
|
|
mysql version: 5.7
|
|
mysql database: 'part-db'
|
|
mysql root password: '1234'
|
|
|
|
- name: Install composer dependencies
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '12'
|
|
|
|
- name: Install yarn dependencies
|
|
run: yarn install
|
|
|
|
- name: Build frontend
|
|
run: yarn build
|
|
|
|
- name: Create DB
|
|
run: php bin/console --env test doctrine:database:create --if-not-exists -n
|
|
|
|
- name: Do migrations
|
|
run: php bin/console --env tes doctrine:migrations:migrate -n
|
|
|
|
- name: Load fixtures
|
|
run: php bin/console --env test doctrine:fixtures:load -n
|
|
|
|
- name: Run PHPunit
|
|
run: ./bin/phpunit
|