diff --git a/.github/actions/health_check_action.yml b/.github/actions/health_check_action.yml new file mode 100644 index 0000000000..36d180d96e --- /dev/null +++ b/.github/actions/health_check_action.yml @@ -0,0 +1,16 @@ +name: 'URL Health Check' +description: 'Performs URL health check with retries' +inputs: + url: + description: 'Health check URL' + required: true +runs: + using: 'composite' + steps: + - shell: bash + run: | + for i in {1..20}; do + curl --fail -v "${{ inputs.url }}" && exit 0 + sleep 5 + done + exit 1 \ No newline at end of file diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 57e90dfd66..1e4a0614f8 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -13,7 +13,6 @@ env: USER_NAME: root USER_UID: 1000 USER_GID: 1000 - TZ: Europe/Berlin DOCKER_USER: ${{ secrets.DOCKER_USER }} DOCKER_PASS: ${{ secrets.DOCKER_PASS }} @@ -150,28 +149,20 @@ jobs: docker compose up -d webknossos-tracingstore - name: Run webknossos smoke test - run: | - for i in {1..20}; do # retry - curl --fail -v http://localhost:9000/api/health && s=0 && break || s=$? - sleep 5 - done - (exit $s) + uses: ./.github/actions/health_check_action + with: + url: http://localhost:9000/api/health + - name: Run webknossos-datastore smoke test - run: | - for i in {1..20}; do # retry - curl --fail -v http://localhost:9090/data/health && s=0 && break || s=$? - sleep 5 - done - (exit $s) + uses: ./.github/actions/health_check_action + with: + url: http://localhost:9090/data/health - name: Run webknossos-tracingstore smoke test - run: | - for i in {1..20}; do # retry - curl --fail -v http://localhost:9050/tracings/health && s=0 && break || s=$? - sleep 5 - done - (exit $s) + uses: ./.github/actions/health_check_action + with: + url: http://localhost:9050/tracings/health - name: Stop webknossos, datastore, and tracingstore run: docker compose down --volumes --remove-orphans diff --git a/docker-compose.yml b/docker-compose.yml index 76f802426b..70232a2356 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -105,8 +105,8 @@ services: - POSTGRES_USER=webknossos_user - POSTGRES_PASSWORD=secret_password - HOME=/root - - CIRCLE_TAG=${CIRCLE_TAG} - - CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} + - CI_TAG=${GITHUB_REF} + - CI_BUILD_NUM=${GITHUB_JOB} - NODE_OPTIONS=--max_old_space_size=2048 # This will be picked up by ava so that the tests fail if a snapshot doesn't exist during CI, see https://github.com/avajs/ava/issues/1585 - CI diff --git a/project/BuildInfoSettings.scala b/project/BuildInfoSettings.scala index a16d0223fe..229e55b575 100644 --- a/project/BuildInfoSettings.scala +++ b/project/BuildInfoSettings.scala @@ -13,8 +13,8 @@ object BuildInfoSettings { } val ciBuild: String = - if (System.getenv().containsKey("CIRCLE_BUILD_NUM")) System.getenv().get("CIRCLE_BUILD_NUM") else "" - val ciTag: String = if (System.getenv().containsKey("CIRCLE_TAG")) System.getenv().get("CIRCLE_TAG") else "" + if (System.getenv().containsKey("CI_BUILD_NUM")) System.getenv().get("CI_BUILD_NUM") else "" + val ciTag: String = if (System.getenv().containsKey("CI_TAG")) System.getenv().get("CI_TAG") else "" def commitHash: String = getStdoutFromCommand("git rev-parse HEAD", "") def commitDate: String = getStdoutFromCommand("git log -1 --format=%cd ", "")