-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (75 loc) · 2.33 KB
/
unit_tests.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: unit tests
# use https://marketplace.visualstudio.com/items?itemName=me-dutour-mathieu.vscode-github-actions to validate yml in vscode
env:
DOCKER_DRIVER: overlay
rIds: ${{ secrets.rIds }}
phpVersion: 7.1
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: php-actions/composer@v5
# - name: PHPUnit Tests
# uses: php-actions/phpunit@v2
# env:
# TEST_NAME: Scarlett
# with:
# bootstrap: vendor/autoload.php
# configuration: test/phpunit.xml
# args: --coverage-text
unit_test_db_mysql:
runs-on: ubuntu-latest
# Service containers to run with `runner-job`
services:
# Label used to access the service container
mysql:
# Docker Hub image
image: mysql:5.7.29
#
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
MYSQL_DATABASE: "testcomments"
MYSQL_ROOT_PASSWORD: "mysecretpw"
steps:
- uses: actions/checkout@v2
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: '7.4.9'
tools: composer:v2
- name: composer
run: composer install
- name: enabledb
run: |
cp ./config/connections-github.php ./config/connections.php
cp library/mailFunctions-sendGrid.php library/mailFunctions.php
php ./tests/initialize.php
# Environment variables used by the `client.js` script to create a new PostgreSQL table.
env:
# The hostname used to communicate with the PostgreSQL service container
MYSQL_HOST: localhost
- name: run tests
run: vendor/bin/phpunit
env:
# The hostname used to communicate with the PostgreSQL service container
MYSQL_HOST: localhost
# - uses: php-actions/composer@v5
# - name: PHPUnit Tests
# uses: php-actions/phpunit@v2
# env:
# TEST_NAME: Scarlett
# with:
# bootstrap: vendor/autoload.php
# configuration: phpunit.xml
# php_version
# args: --coverage-text