|
| 1 | +# GitHub Action for PHP with extensions |
| 2 | +name: macOS |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - v5 |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - v5 |
| 11 | + |
| 12 | +jobs: |
| 13 | + windows: |
| 14 | + name: macOS (PHP ${{ matrix.php-versions }} CI) |
| 15 | + runs-on: macos-latest |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + operating-system: [macos-latest] |
| 20 | + php-versions: ['7.3'] |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v2 |
| 25 | + - name: Setup PHP, with composer and extensions |
| 26 | + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php |
| 27 | + with: |
| 28 | + php-version: ${{ matrix.php-versions }} |
| 29 | + extensions: mbstring, fileinfo, mysqli, pdo_mysql, pgsql, pdo_pgsql, sqlite3, pdo_sqlite, sqlsrv, pdo_sqlsrv, xdebug |
| 30 | + coverage: xdebug |
| 31 | + - name: Brew Install MySQL |
| 32 | + run: brew install [email protected] |
| 33 | + - name: Brew Start MySQL |
| 34 | + run: | |
| 35 | + brew services start [email protected] |
| 36 | + brew link [email protected] --force |
| 37 | + mysqld --initialize |
| 38 | + mysql -V |
| 39 | + - name: Setup MySQL Database |
| 40 | + run: | |
| 41 | + mysql -u root -e "CREATE DATABASE IF NOT EXISTS ez_test;" |
| 42 | + mysql -u root -e "CREATE USER ez_test@localhost IDENTIFIED BY 'ezTest'; GRANT ALL ON ez_test.* TO ez_test@localhost; FLUSH PRIVILEGES;" |
| 43 | + - name: Brew Start PostgreSql |
| 44 | + run: brew services restart postgresql |
| 45 | + - name: Setup PostgreSql Database |
| 46 | + run: | |
| 47 | + psql --command="CREATE USER ez_test PASSWORD 'ezTest'" --command="\du" |
| 48 | + createdb --owner=ez_test ez_test |
| 49 | + - name: Docker Install SQLServer |
| 50 | + run: | |
| 51 | + docker pull mcr.microsoft.com/mssql/server:2019-latest |
| 52 | + docker run --name ms_sql_server -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Password12!' -p 1433:1433 -p 1434:1434 -d mcr.microsoft.com/mssql/server:2019-latest |
| 53 | + - name: Brew Install ODBC 17 and MSSQL Tools |
| 54 | + run: | |
| 55 | + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
| 56 | + brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release |
| 57 | + brew update |
| 58 | + HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=y brew install mssql-tools |
| 59 | + - name: Setup SQLServer Database |
| 60 | + run: | |
| 61 | + sqlcmd -S localhost,1433 -U sa -P Password12! -Q "CREATE DATABASE ez_test" |
| 62 | + sqlcmd -S localhost,1433 -U sa -P Password12! -d ez_test -Q "CREATE LOGIN ez_test WITH PASSWORD=N'ezTest', DEFAULT_DATABASE=ez_test, CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF; ALTER SERVER ROLE [sysadmin] ADD MEMBER ez_test" |
| 63 | + - name: Install dependencies |
| 64 | + run: composer update |
| 65 | + - name: Test with phpunit |
| 66 | + run: vendor/bin/phpunit --coverage-clover=coverage.xml |
| 67 | + - name: Submit code coverage |
| 68 | + uses: codecov/codecov-action@v1 |
| 69 | + with: |
| 70 | + file: ./coverage.xml # optional |
0 commit comments