From 663847e2cdd3b8d4f067a26f1d0e9a14b8614424 Mon Sep 17 00:00:00 2001 From: jessevz Date: Thu, 16 Jan 2025 10:26:24 +0100 Subject: [PATCH] Created a reusable workflow for starting Hashtopolis server --- .github/workflows/ci.yml | 7 ++----- .github/workflows/docs.yml | 7 ++----- .github/workflows/start_server.yml | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/start_server.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b238c291..6bd9776a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Start application containers - working-directory: .devcontainer - run: docker compose up -d - - name: Wait until entrypoint is finished and Hashtopolis is started - run: bash .github/scripts/await-hashtopolis-startup.sh + - name: Start Hashtopolis + uses: ./.github/workflows/start_server.yml - name: Give Apache permissions on necessary directories # for the tests, only src/files and src/inc/utils/locks seem necessary 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" - name: Run test suite diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bf3421659..1e43b38b1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,11 +25,8 @@ jobs: sudo apt-get install nodejs sudo apt-get install npm sudo npm i openapi-to-md -g - - name: Start application containers #same steps as in ci.yml, might make it more modular in the future - working-directory: .devcontainer - run: docker compose up -d - - name: Wait until entrypoint is finished and Hashtopolis is started - run: bash .github/scripts/await-hashtopolis-startup.sh + - name: Start Hashtopolis + uses: ./.github/workflows/start_server.yml - name: Download newest apiv2 spec run: | wget http://localhost:8080/api/v2/openapi.json -P /tmp/ diff --git a/.github/workflows/start_server.yml b/.github/workflows/start_server.yml new file mode 100644 index 000000000..7da82e21f --- /dev/null +++ b/.github/workflows/start_server.yml @@ -0,0 +1,15 @@ +name: Start Hashtopolis server + +on: + workflow_call: + +jobs: + start-hashtopolis: + runs-on: ubbuntu-latest + + steps: + - name: Start application containers + working-directory: .devcontainer + run: docker compose up -d + - name: Wait until entrypoint is finished and Hashtopolis is started + run: bash .github/scripts/await-hashtopolis-startup.sh \ No newline at end of file