Skip to content

Commit 2af39b7

Browse files
committed
try 10
1 parent 15d628e commit 2af39b7

File tree

1 file changed

+76
-62
lines changed

1 file changed

+76
-62
lines changed

.github/workflows/tests.yaml

+76-62
Original file line numberDiff line numberDiff line change
@@ -3,70 +3,84 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- main
6+
- master
77
pull_request:
88
jobs:
9-
build:
9+
Sqlite:
1010
runs-on: ubuntu-latest
11-
12-
strategy:
13-
matrix:
14-
php: [7.0]
15-
db: [sqlite]
16-
# php: [7.0, 5.6]
17-
# db: [sqlite, mysql, postgres]
18-
19-
env:
20-
PLUGIN: Wiki
21-
KANBOARD_REPO: https://github.com/kanboard/kanboard.git
22-
11+
container: kanboard/tests:latest
2312
steps:
24-
- name: Check out code
25-
uses: actions/checkout@v2
26-
27-
- name: Set up PHP
28-
uses: shivammathur/setup-php@v2
29-
with:
30-
php-version: ${{ matrix.php }}
31-
32-
- name: install phpenv
33-
run: |
34-
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer | PHPENV_ROOT=$HOME/.phpenv-root bash
35-
mkdir -p $HOME/.local/bin && ln -s $HOME/.phpenv-root/bin/phpenv $HOME/.local/bin/phpenv
36-
eval "$(phpenv init -)"
37-
exec $SHELL -l
38-
39-
40-
# echo 'export PATH="${PHPENV_ROOT}/bin:${PATH}"' >> ~/.bash_profile
41-
# FILE="$PHPENV_ROOT/bin/phpenv"
42-
# if [ -f "$FILE" ]; then
43-
# echo "$FILE exists."
44-
# fi
45-
# export PATH="${PHPENV_ROOT}/bin:${PATH}"
46-
47-
# source ~/.bash_profile
48-
# - name: ls $PHPENV_ROOT
49-
# run: ls $PHPENV_ROOT
50-
51-
# - name: ls $PHPENV_ROOT/bin
52-
# run: ls $PHPENV_ROOT/bin
53-
54-
- name: Clone Kanboard repository
55-
run: git clone --depth 1 $KANBOARD_REPO
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/
5625

57-
- name: Create symbolic link
58-
run: ln -s ${{ github.workspace }} kanboard/plugins/$PLUGIN
59-
60-
61-
# - phpenv config-add tests/php.ini
62-
63-
- name: Install Composer dependencies
64-
run: |
65-
cd kanboard
66-
composer install
67-
68-
- name: List plugin directory
69-
run: ls -la plugins/
70-
71-
- name: Run PHPUnit tests
72-
run: phpunit -c tests/units.${{ matrix.db }}.xml plugins/$PLUGIN/Test/
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

Comments
 (0)