-
Notifications
You must be signed in to change notification settings - Fork 289
56 lines (53 loc) · 1.92 KB
/
ezsql-linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# GitHub Action for PHP with extensions
name: Linux
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
linux:
name: Linux (PHP ${{ matrix.php-versions }} CI)
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-18.04]
php-versions: ['7.4', '8.0', '8.1']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #/~https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, fileinfo, mysqli, pdo_mysql, pgsql, pdo_pgsql, sqlite3, pdo_sqlite, sqlsrv, pdo_sqlsrv, xdebug
coverage: xdebug
- name: Start MySQL
run: sudo systemctl start mysql.service
- name: Setup MySQL Database
run: |
mysql -uroot -h127.0.0.1 -proot -e "CREATE DATABASE IF NOT EXISTS ez_test;"
mysql -uroot -h127.0.0.1 -proot -e "CREATE USER ez_test@localhost IDENTIFIED BY 'ezTest'; GRANT ALL ON ez_test.* TO ez_test@localhost; FLUSH PRIVILEGES;"
- name: Start PostgreSql
run: |
sudo systemctl start postgresql.service
pg_isready
- name: Create additional user
run: |
sudo -u postgres psql --command="CREATE USER ez_test PASSWORD 'ezTest'" --command="\du"
- name: Setup PostgreSql Database
run: |
sudo -u postgres createdb --owner=ez_test ez_test
- name: Setup SQLServer Database
run: |
chmod +x "${GITHUB_WORKSPACE}/.github/install_mssql.sh"
"${GITHUB_WORKSPACE}/.github/install_mssql.sh"
- name: Install dependencies
run: composer update
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Submit code coverage
run: bash <(curl -s https://codecov.io/bash)