Skip to content
Closed
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
29 changes: 29 additions & 0 deletions .github/workflows/guides-e2e-screenshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# TEMPORARY: end-to-end check for the draft /guides Actions guide (PR #1024).
# Mirrors the guide's workflow. Delete this branch after the run.
on: pull_request

permissions:
contents: read
pull-requests: write

jobs:
screenshots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Write a test screenshot
run: |
mkdir -p shots
python3 -c "
import zlib, struct
w, h = 800, 400
raw = b''.join(b'\x00' + bytes([31, 41, 55]) * w for _ in range(h))
def chunk(t, d): return struct.pack('>I', len(d)) + t + d + struct.pack('>I', zlib.crc32(t + d))
png = b'\x89PNG\r\n\x1a\n' + chunk(b'IHDR', struct.pack('>IIBBBBB', w, h, 8, 2, 0, 0, 0)) + chunk(b'IDAT', zlib.compress(raw)) + chunk(b'IEND', b'')
open('shots/ci-e2e.png', 'wb').write(png)
"
- run: npm install -g @buildinternet/uploads
- run: uploads put ./shots/*.png --pr ${{ github.event.pull_request.number }}
env:
UPLOADS_TOKEN: ${{ secrets.UPLOADS_TOKEN }}
GH_TOKEN: ${{ github.token }}
Loading