Skip to content

Commit

Permalink
mcb-update-actions - Give more time for server start
Browse files Browse the repository at this point in the history
  • Loading branch information
M-casado committed Jun 24, 2024
1 parent 83b4741 commit 433f37c
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/json_validation_deploying_biovalidator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
# See https://github.com/elixir-europe/biovalidator#installation
# We want to test the "main" branch of the project
run: git clone https://github.com/elixir-europe/biovalidator.git

- name: Install Biovalidator
# We want to test with the latest Node.js version, but if not, we
# could make use of action: https://github.com/actions/setup-node
Expand All @@ -59,11 +60,22 @@ jobs:
# changes. Therefore we specify the schemas at deployment level (-r)
run: |
schemas_dir="./schemas"
node biovalidator/src/biovalidator -r "$schemas_dir/*.json" > biovalidator.log 2>&1 &
node biovalidator/src/biovalidator -r "$schemas_dir/*.json" &
# We stop for a few seconds to give the server time
sleep 3
# Check if the server is up and running, and wait for a few seconds if not
for i in {1..10}; do
if curl --output /dev/null --silent --head --fail "http://localhost:3020/validate"; then
echo "Biovalidator server is up!"
break
fi
echo "Waiting ($i time(s)) for Biovalidator server to start..."
sleep 5
done
if ! curl --output /dev/null --silent --head --fail "http://localhost:3020/validate"; then
echo "Biovalidator server failed to start"
cat biovalidator.log
exit 1
fi
- uses: actions/setup-python@v4
with:
Expand All @@ -86,5 +98,4 @@ jobs:
# The following URL points to the locally deployed server of
# Biovalidator
url="http://localhost:3020/validate"
python3 ./.github/scripts/request_validation.py "$json_ex_dir" "$url"
python3 ./.github/scripts/request_validation.py "$json_ex_dir" "$url"

0 comments on commit 433f37c

Please sign in to comment.