1
+ name : ' Unit Tests'
2
+ on :
3
+ workflow_dispatch :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ jobs :
9
+ Sqlite :
10
+ runs-on : ubuntu-latest
11
+ container : kanboard/tests:latest
12
+ steps :
13
+ - name : Checkout Kanboard repo
14
+ uses : actions/checkout@v2
15
+ with :
16
+ repository : kanboard/kanboard
17
+ - name : Checkout Plugin repo
18
+ uses : actions/checkout@v2
19
+ with :
20
+ path : plugins/Wiki
21
+ - name : Install dependencies
22
+ run : composer install --prefer-dist --no-progress --no-suggest
23
+ - name : Unit tests with Sqlite
24
+ run : ./vendor/bin/phpunit -c tests/units.sqlite.xml plugins/Wiki/Test/
25
+
26
+ Postgres :
27
+ runs-on : ubuntu-latest
28
+ container : kanboard/tests:latest
29
+ services :
30
+ postgres :
31
+ image : postgres:9.4
32
+ env :
33
+ POSTGRES_USER : postgres
34
+ POSTGRES_PASSWORD : postgres
35
+ POSTGRES_DB : postgres
36
+ ports :
37
+ - 5432:5432
38
+ options : >-
39
+ --health-cmd pg_isready
40
+ --health-interval 10s
41
+ --health-timeout 5s
42
+ --health-retries 5
43
+ steps :
44
+ - name : Checkout Kanboard repo
45
+ uses : actions/checkout@v2
46
+ with :
47
+ repository : kanboard/kanboard
48
+ - name : Checkout Plugin repo
49
+ uses : actions/checkout@v2
50
+ with :
51
+ path : plugins/Wiki
52
+ - name : Install dependencies
53
+ run : composer install --prefer-dist --no-progress --no-suggest
54
+ - name : Unit tests with Postgres
55
+ run : ./vendor/bin/phpunit -c tests/units.postgres.xml plugins/Wiki/Test/
56
+ env :
57
+ DB_HOSTNAME : postgres
58
+ DB_PORT : ${{ job.services.postgres.ports[5432] }}
59
+
60
+ MariaDB :
61
+ runs-on : ubuntu-latest
62
+ container : kanboard/tests:latest
63
+ services :
64
+ mariadb :
65
+ image : mariadb:latest
66
+ env :
67
+ MYSQL_ROOT_PASSWORD : secret
68
+ ports :
69
+ - 3306:3306
70
+ steps :
71
+ - name : Checkout Kanboard repo
72
+ uses : actions/checkout@v2
73
+ with :
74
+ repository : kanboard/kanboard
75
+ - name : Checkout Plugin repo
76
+ uses : actions/checkout@v2
77
+ with :
78
+ path : plugins/Wiki
79
+ - name : Install dependencies
80
+ run : composer install --prefer-dist --no-progress --no-suggest
81
+ - name : Unit tests with MariaDB
82
+ run : ./vendor/bin/phpunit -c tests/units.mysql.xml plugins/Wiki/Test/
83
+ env :
84
+ DB_HOSTNAME : mariadb
85
+ DB_PASSWORD : secret
86
+ DB_PORT : ${{ job.services.mariadb.ports[3306] }}
0 commit comments