Merge pull request #85 from righel/add-test-workflow-gh-action
add: github action test workflowpull/86/head
commit
e9e9c7f43e
|
@ -0,0 +1,52 @@
|
|||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 5
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
php: ["7.4"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Create config files
|
||||
run: |
|
||||
cp ./config/app_local.example.php ./config/app_local.php
|
||||
cp ./config/config.example.json ./config/config.json
|
||||
|
||||
- name: Setup MariaDB
|
||||
uses: getong/mariadb-action@v1.1
|
||||
with:
|
||||
host port: 3306
|
||||
container port: 3306
|
||||
mysql database: "cerebrate_test"
|
||||
mysql user: "cerebrate"
|
||||
mysql password: "cerebrate"
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: pdo, pdo_mysql, mysqli, simplexml
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
php_version: ${{ matrix.php }}
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get install -y --no-install-recommends curl git zip unzip libicu-dev libxml2-dev
|
||||
composer install --no-progress --no-interaction
|
||||
|
||||
- name: Run tests
|
||||
run: composer test
|
||||
env:
|
||||
DEBUG: true
|
|
@ -55,7 +55,7 @@
|
|||
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
|
||||
"stan": "phpstan analyse src/",
|
||||
"test": [
|
||||
"sh ./tests/Helper/wiremock/start.sh",
|
||||
"nohup sh ./tests/Helper/wiremock/start.sh >/dev/null 2>&1 &",
|
||||
"phpunit",
|
||||
"sh ./tests/Helper/wiremock/stop.sh"
|
||||
]
|
||||
|
|
|
@ -73,12 +73,10 @@ return [
|
|||
* The test connection is used during the test suite.
|
||||
*/
|
||||
'test' => [
|
||||
'host' => 'localhost',
|
||||
//'port' => 'non_standard_port_number',
|
||||
'username' => 'my_app',
|
||||
'password' => 'secret',
|
||||
'database' => 'test_myapp',
|
||||
//'schema' => 'myapp',
|
||||
'host' => '127.0.0.1',
|
||||
'username' => 'cerebrate',
|
||||
'password' => 'cerebrate',
|
||||
'database' => 'cerebrate_test',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
Loading…
Reference in New Issue