Skip to content

Commit

Permalink
Fix nightly tests (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Nov 20, 2024
1 parent 645ed72 commit 7f3b51f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 35 deletions.
38 changes: 3 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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'
Expand Down
18 changes: 18 additions & 0 deletions scripts/ci/ping.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7f3b51f

Please sign in to comment.