Skip to content

Commit d636cec

Browse files
committed
Run integration tests on Github Actions
1 parent 55f4a6e commit d636cec

18 files changed

+119
-286
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Integration Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
Sqlite:
9+
runs-on: ubuntu-latest
10+
container: kanboard/tests:latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Validate composer.json and composer.lock
14+
run: composer validate
15+
- name: Install dependencies
16+
run: composer install --prefer-dist --no-progress --no-suggest
17+
- name: Start Apache
18+
run: /etc/init.d/apache2 start
19+
- name: Link document root
20+
run: |
21+
rm -rf /var/www/html
22+
ln -s $GITHUB_WORKSPACE /var/www/html
23+
cp tests/configs/config.sqlite.php /var/www/html/config.php
24+
chown -R www-data:www-data /var/www/html/data
25+
ls -l /var/www/html/
26+
- name: Integration tests with Sqlite
27+
run: ./vendor/bin/phpunit -c tests/integration.sqlite.xml
28+
29+
Postgres:
30+
runs-on: ubuntu-latest
31+
container: kanboard/tests:latest
32+
services:
33+
postgres:
34+
image: postgres:9.4
35+
env:
36+
POSTGRES_USER: postgres
37+
POSTGRES_PASSWORD: postgres
38+
POSTGRES_DB: kanboard
39+
ports:
40+
- 5432:5432
41+
options: >-
42+
--health-cmd pg_isready
43+
--health-interval 10s
44+
--health-timeout 5s
45+
--health-retries 5
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Validate composer.json and composer.lock
49+
run: composer validate
50+
- name: Install dependencies
51+
run: composer install --prefer-dist --no-progress --no-suggest
52+
- name: Start Apache
53+
run: /etc/init.d/apache2 start
54+
- name: Link document root
55+
run: |
56+
rm -rf /var/www/html
57+
ln -s $GITHUB_WORKSPACE /var/www/html
58+
cp tests/configs/config.postgres.php /var/www/html/config.php
59+
chown -R www-data:www-data /var/www/html/data
60+
ls -l /var/www/html/
61+
- name: Integration tests with Postgres
62+
run: ./vendor/bin/phpunit -c tests/integration.postgres.xml
63+
env:
64+
DB_HOSTNAME: postgres
65+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
66+
67+
Mysql:
68+
runs-on: ubuntu-latest
69+
container: kanboard/tests:latest
70+
services:
71+
mysql:
72+
image: mysql:5.7
73+
env:
74+
MYSQL_ROOT_PASSWORD: "kanboard"
75+
MYSQL_DATABASE: "kanboard"
76+
MYSQL_USER: "kanboard"
77+
MYSQL_PASSWORD: "kanboard"
78+
ports:
79+
- 3306:3306
80+
options: >-
81+
--health-cmd="mysqladmin ping"
82+
--health-interval 10s
83+
--health-timeout 5s
84+
--health-retries 10
85+
steps:
86+
- uses: actions/checkout@v2
87+
- name: Validate composer.json and composer.lock
88+
run: composer validate
89+
- name: Install dependencies
90+
run: composer install --prefer-dist --no-progress --no-suggest
91+
- name: Start Apache
92+
run: /etc/init.d/apache2 start
93+
- name: Link document root
94+
run: |
95+
rm -rf /var/www/html
96+
ln -s $GITHUB_WORKSPACE /var/www/html
97+
cp tests/configs/config.mysql.php /var/www/html/config.php
98+
chown -R www-data:www-data /var/www/html/data
99+
ls -l /var/www/html/
100+
- name: Integration tests with Mysql
101+
run: ./vendor/bin/phpunit -c tests/integration.mysql.xml
102+
env:
103+
DB_HOSTNAME: mysql
104+
DB_PORT: ${{ job.services.mysql.ports[3306] }}

Makefile

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,6 @@ test-mysql:
1919
test-postgres:
2020
@ ./vendor/bin/phpunit -c tests/units.postgres.xml
2121

22-
test-browser:
23-
@ ./vendor/bin/phpunit -c tests/acceptance.xml
24-
25-
integration-test-mysql:
26-
@ composer install --dev
27-
@ docker-compose -f tests/docker/compose.integration.mysql.yaml build
28-
@ docker-compose -f tests/docker/compose.integration.mysql.yaml up -d mysql app
29-
@ docker-compose -f tests/docker/compose.integration.mysql.yaml up tests
30-
@ docker-compose -f tests/docker/compose.integration.mysql.yaml down
31-
32-
integration-test-postgres:
33-
@ composer install --dev
34-
@ docker-compose -f tests/docker/compose.integration.postgres.yaml build
35-
@ docker-compose -f tests/docker/compose.integration.postgres.yaml up -d postgres app
36-
@ docker-compose -f tests/docker/compose.integration.postgres.yaml up tests
37-
@ docker-compose -f tests/docker/compose.integration.postgres.yaml down
38-
39-
integration-test-sqlite:
40-
@ composer install --dev
41-
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml build
42-
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml up -d app
43-
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml up tests
44-
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml down
45-
4622
sql:
4723
@ pg_dump --schema-only --no-owner --no-privileges --quote-all-identifiers -n public --file app/Schema/Sql/postgres.sql kanboard
4824
@ pg_dump -d kanboard --column-inserts --data-only --table settings >> app/Schema/Sql/postgres.sql

tests/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# This Dockerfile can be used to run unit tests.
22
# This image is published on the Docker Hub: kanboard/tests:latest
3-
FROM debian:10-slim
3+
FROM ubuntu:20.04
4+
5+
ENV DEBIAN_FRONTEND=noninteractive
46

57
RUN apt-get update -y -q && \
68
apt-get install -y \
9+
apache2 \
10+
libapache2-mod-php \
711
php-cli \
812
php-mbstring \
913
php-sqlite3 \
@@ -21,4 +25,5 @@ RUN apt-get update -y -q && \
2125
git \
2226
make \
2327
mariadb-client \
24-
postgresql-client
28+
postgresql-client \
29+
a2enmod rewrite

tests/acceptance.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/acceptance/Base.php

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/acceptance/UserAuthenticationTest.php

Lines changed: 0 additions & 86 deletions
This file was deleted.

tests/docker/Dockerfile.xenial

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/docker/compose.integration.mysql.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/docker/compose.integration.postgres.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

tests/docker/compose.integration.sqlite.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)