Skip to content

Commit 663847e

Browse files
committed
Created a reusable workflow for starting Hashtopolis server
1 parent 1b0bc92 commit 663847e

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ jobs:
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v3
19-
- name: Start application containers
20-
working-directory: .devcontainer
21-
run: docker compose up -d
22-
- name: Wait until entrypoint is finished and Hashtopolis is started
23-
run: bash .github/scripts/await-hashtopolis-startup.sh
19+
- name: Start Hashtopolis
20+
uses: ./.github/workflows/start_server.yml
2421
- name: Give Apache permissions on necessary directories # for the tests, only src/files and src/inc/utils/locks seem necessary
2522
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"
2623
- name: Run test suite

.github/workflows/docs.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ jobs:
2525
sudo apt-get install nodejs
2626
sudo apt-get install npm
2727
sudo npm i openapi-to-md -g
28-
- name: Start application containers #same steps as in ci.yml, might make it more modular in the future
29-
working-directory: .devcontainer
30-
run: docker compose up -d
31-
- name: Wait until entrypoint is finished and Hashtopolis is started
32-
run: bash .github/scripts/await-hashtopolis-startup.sh
28+
- name: Start Hashtopolis
29+
uses: ./.github/workflows/start_server.yml
3330
- name: Download newest apiv2 spec
3431
run: |
3532
wget http://localhost:8080/api/v2/openapi.json -P /tmp/

.github/workflows/start_server.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Start Hashtopolis server
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
start-hashtopolis:
8+
runs-on: ubbuntu-latest
9+
10+
steps:
11+
- name: Start application containers
12+
working-directory: .devcontainer
13+
run: docker compose up -d
14+
- name: Wait until entrypoint is finished and Hashtopolis is started
15+
run: bash .github/scripts/await-hashtopolis-startup.sh

0 commit comments

Comments
 (0)