Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
console:
runs-on: ubuntu-latest
name: Get console logs
env:
PREVIEW_URL: https://primajin.github.io/Gyros/pr-preview/pr-${{ github.event.number }}/
steps:
- name: Wait for build to succeed
uses: fountainhead/[email protected]
Expand All @@ -25,16 +27,31 @@ jobs:
if: steps.wait-for-build.outputs.conclusion == 'failure'
run: exit 1
shell: bash
- name: Sleep for 120 seconds
- name: Wait for preview URL to be available
if: steps.wait-for-build.outputs.conclusion == 'success'
run: sleep 120s
shell: bash
run: |
echo "Polling ${PREVIEW_URL} ..."
timeout=180
elapsed=0
until [ "$elapsed" -ge "$timeout" ]; do
status=$(curl --silent --output /dev/null --write-out "%{http_code}" "${PREVIEW_URL}" || true)
if [[ "$status" =~ ^2 ]]; then
echo "Preview is live (HTTP ${status})"
exit 0
fi
echo "HTTP ${status} – retrying in 5 s (${elapsed}/${timeout}s elapsed)"
sleep 5
elapsed=$((elapsed + 5))
done
echo "Timed out waiting for preview after ${timeout}s"
exit 1
- name: Checkout code
uses: actions/checkout@v7
- name: Use WebApp Console Log Action
uses: Primajin/[email protected]
with:
webapp-url: https://primajin.github.io/Gyros/pr-preview/pr-${{ github.event.number }}/
webapp-url: ${{ env.PREVIEW_URL }}
regexp-error: 'Failed \D+ 404 \(\)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 20 additions & 4 deletions .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
screenshots:
runs-on: ubuntu-latest
name: Take a screenshot after page was built
env:
PREVIEW_URL: https://primajin.github.io/Gyros/pr-preview/pr-${{ github.event.number }}/
steps:
- name: Wait for build to succeed
uses: fountainhead/[email protected]
Expand All @@ -25,10 +27,25 @@ jobs:
if: steps.wait-for-build.outputs.conclusion == 'failure'
run: exit 1
shell: bash
- name: Sleep for 120 seconds
- name: Wait for preview URL to be available
if: steps.wait-for-build.outputs.conclusion == 'success'
run: sleep 120s
shell: bash
run: |
echo "Polling ${PREVIEW_URL} ..."
timeout=180
elapsed=0
until [ "$elapsed" -ge "$timeout" ]; do
status=$(curl --silent --output /dev/null --write-out "%{http_code}" "${PREVIEW_URL}" || true)
if [[ "$status" =~ ^2 ]]; then
echo "Preview is live (HTTP ${status})"
exit 0
fi
echo "HTTP ${status} – retrying in 5 s (${elapsed}/${timeout}s elapsed)"
sleep 5
elapsed=$((elapsed + 5))
done
echo "Timed out waiting for preview after ${timeout}s"
exit 1
- name: Checkout code
uses: actions/checkout@v7
- name: install puppeteer-headful
Expand All @@ -43,10 +60,9 @@ jobs:
noDesktop: true
releaseId: 315671617
type: png
url: ${{ env.PR_NUMBER }}
url: ${{ env.PREVIEW_URL }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: https://primajin.github.io/Gyros/pr-preview/pr-${{ github.event.number }}/
- uses: actions/upload-artifact@v7
with:
path: screenshots
Expand Down
Loading