Skip to content

Commit c3c0209

Browse files
committed
updated github actions to run both systems
1 parent bd8ddb7 commit c3c0209

File tree

6 files changed

+71
-2
lines changed

6 files changed

+71
-2
lines changed

.devcontainer/docker-compose.yml renamed to .devcontainer/docker-compose.mysql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ services:
99
- CONTAINER_USER_CMD_PRE
1010
- CONTAINER_USER_CMD_POST
1111
environment:
12+
HASHTOPOLIS_DB_TYPE: mysql
1213
HASHTOPOLIS_DB_USER: hashtopolis
1314
HASHTOPOLIS_DB_PASS: hashtopolis
1415
HASHTOPOLIS_DB_HOST: hashtopolis-db-dev
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: "3.7"
2+
services:
3+
hashtopolis-server-dev:
4+
container_name: hashtopolis-server-dev
5+
build:
6+
context: ..
7+
target: hashtopolis-server-dev
8+
args:
9+
- CONTAINER_USER_CMD_PRE
10+
- CONTAINER_USER_CMD_POST
11+
environment:
12+
HASHTOPOLIS_DB_TYPE: postgres
13+
HASHTOPOLIS_DB_USER: hashtopolis
14+
HASHTOPOLIS_DB_PASS: hashtopolis
15+
HASHTOPOLIS_DB_HOST: hashtopolis-db-dev
16+
HASHTOPOLIS_DB_DATABASE: hashtopolis
17+
HASHTOPOLIS_APIV2_ENABLE: 1
18+
depends_on:
19+
- hashtopolis-db-dev
20+
ports:
21+
- "8080:80"
22+
volumes:
23+
# This is where VS Code should expect to find your project's source code
24+
# and the value of "workspaceFolder" in .devcontainer/devcontainer.json
25+
- ..:/var/www/html
26+
- hashtopolis-server-dev:/usr/local/share/hashtopolis:Z
27+
networks:
28+
- hashtopolis_dev
29+
hashtopolis-db-dev:
30+
container_name: hashtopolis-db-dev
31+
image: mysql:8.0
32+
restart: always
33+
ports:
34+
- "3306:3306"
35+
volumes:
36+
- hashtopolis-db-dev:/var/lib/mysql
37+
environment:
38+
MYSQL_ROOT_PASSWORD: hashtopolis
39+
MYSQL_DATABASE: hashtopolis
40+
MYSQL_USER: hashtopolis
41+
MYSQL_PASSWORD: hashtopolis
42+
networks:
43+
- hashtopolis_dev
44+
volumes:
45+
hashtopolis-db-dev:
46+
hashtopolis-server-dev:
47+
48+
networks:
49+
hashtopolis_dev:
50+
# This network will also be used by the python-agent
51+
name: hashtopolis_dev

.github/actions/start-hashtopolis/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: Start Hashtopolis server
22
description: Starts application containers and waits for Hashtopolis to be ready.
33

4+
inputs:
5+
db_system:
6+
description: "Used to set which DB system should be used"
7+
required: true
8+
default: "mysql"
9+
410
runs:
511
using: "composite"
612
steps:
713
- name: Start application containers
814
working-directory: .devcontainer
9-
run: docker compose up -d
15+
run: docker compose up -f docker-compose.${{ env.INPUT_DB_SYSTEM }}.yml
1016
shell: bash
1117
- name: Install composer dependencies packages
1218
run: docker exec hashtopolis-server-dev composer install --working-dir=/var/www/html/

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ on:
1313
jobs:
1414
build:
1515
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
include:
19+
- db_system: mysql
20+
- db_system: postgres
1621
steps:
1722
- name: Checkout repository
1823
uses: actions/checkout@v3
1924
- name: Start Hashtopolis server
2025
uses: ./.github/actions/start-hashtopolis
26+
with:
27+
db_system: ${{ matrix.db_system }}
2128
- name: Give Apache permissions on necessary directories # for the tests, only src/files and src/inc/utils/locks seem necessary
2229
run: docker exec -u root hashtopolis-server-dev bash -c "chown -R www-data:www-data /var/www/html/src && chmod -R g+w /var/www/html/src"
2330
- name: Run test suite

.github/workflows/docs-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
sudo apt-get install npm
3030
- name: Start Hashtopolis server
3131
uses: ./.github/actions/start-hashtopolis
32+
with:
33+
db_system: "mysql"
3234
- name: Download newest apiv2 spec
3335
run: |
3436
wget http://localhost:8080/api/v2/openapi.json -P /tmp/

.github/workflows/docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ jobs:
2626
sudo apt-get install php
2727
sudo apt-get install -y lftp
2828
sudo apt-get install nodejs
29-
sudo apt-get install npm
29+
sudo apt-get install npm
3030
- name: Start Hashtopolis server
3131
uses: ./.github/actions/start-hashtopolis
32+
with:
33+
db_system: "mysql"
3234
- name: Download newest apiv2 spec
3335
run: |
3436
wget http://localhost:8080/api/v2/openapi.json -P /tmp/

0 commit comments

Comments
 (0)