From 7e5ebffd29e9d703532b9337177c0d3c118c3ca4 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Sun, 17 Nov 2024 14:32:48 -0500 Subject: [PATCH 1/2] Fix nightly tests --- .github/workflows/test.yml | 38 +++----------------------------------- scripts/ci/ping.sh | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 35 deletions(-) create mode 100644 scripts/ci/ping.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 262d11740..c59ec274c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - # TODO: someone with more windows chops please add windows test support - # os: [windows-latest, ubuntu-latest, macos-latest] - # TODO: keep an eye when macos-14+ (M1) support is available - os: [ubuntu-latest] + os: [ubuntu-22.04, ubuntu-24.04] steps: - name: Checkout code uses: actions/checkout@v4 @@ -28,16 +25,7 @@ jobs: run: |- echo "TAG=main" >> $GITHUB_OUTPUT - - name: Setup make and secrets for Windows - if: matrix.os == 'windows-latest' - run: | - choco install mingw -y - echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" >> $GITHUB_PATH - cp sample.env .env <-- do not know what windows cp. COPY? - C:\Program Files\Git\bin\bash.exe ./build/scripts/check-secrets.sh yes - - name: init secrets - if: matrix.os != 'windows-latest' run: |- cp sample.env .env ./build/scripts/check-secrets.sh yes @@ -48,17 +36,7 @@ jobs: shell: bash - name: check online - # TODO: what's a windows curl? - if: matrix.os != 'windows-latest' - run: |- - STATUS=$(curl -k \ - -w '%{http_code}' -o /dev/null \ - https://islandora.traefik.me/) - echo "Site check returned ${STATUS}" - if [ ${STATUS} -ne 200 ]; then - echo "Failed to bring up site" - exit 1 - fi + run: ./scripts/ci/ping.sh - name: "Make sure we can export the site config through the UI" run: ./scripts/ci/drush-cex-ui.sh @@ -72,17 +50,7 @@ jobs: shell: bash - name: check online - # TODO: what's a windows curl? - if: matrix.os != 'windows-latest' - run: |- - STATUS=$(curl -k \ - -w '%{http_code}' -o /dev/null \ - https://islandora.traefik.me/) - echo "Site check returned ${STATUS}" - if [ ${STATUS} -ne 200 ]; then - echo "Failed to bring up site" - exit 1 - fi + run: ./scripts/ci/ping.sh - name: Notify Slack on nightly test failure if: failure() && github.event_name == 'schedule' diff --git a/scripts/ci/ping.sh b/scripts/ci/ping.sh new file mode 100644 index 000000000..57ffd6f70 --- /dev/null +++ b/scripts/ci/ping.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +COUNTER=0 +while true; do + HTTP_STATUS=$(curl -w '%{http_code}' -o /dev/null -s https://islandora.traefik.me/) + echo "Ping returned http status ${HTTP_STATUS}, exit code $?" + if [ "${HTTP_STATUS}" -eq 200 ]; then + echo "We're live 🚀" + exit 0 + fi + + ((COUNTER++)) + if [ "${COUNTER}" -eq 50 ]; then + echo "Failed to come online after 4m" + exit 1 + fi + sleep 5; +done From 2c0a4fd32b2e253675db5bb87fd617c24ad10512 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Sun, 17 Nov 2024 14:36:44 -0500 Subject: [PATCH 2/2] chmod +x --- scripts/ci/ping.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/ci/ping.sh diff --git a/scripts/ci/ping.sh b/scripts/ci/ping.sh old mode 100644 new mode 100755