examples/node-playwright-chromium (staging) #152
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: examples/node-playwright-chromium (staging) | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
paths: | |
- '.github/workflows/example-node-playwright-chromium-staging.yaml' | |
- 'node-playwright-chromium/**' | |
- '!node-playwright-chromium/README.md' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: [main] | |
paths: | |
- '.github/workflows/example-node-playwright-chromium-staging.yaml' | |
- 'node-playwright-chromium/**' | |
- '!node-playwright-chromium/README.md' | |
schedule: | |
- cron: '30 16 * * 1-5' | |
# Automatically cancel in-progress actions on the same branch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} | |
cancel-in-progress: true | |
env: | |
UKC_METRO: ${{ vars.UKC_METRO }} | |
UKC_TOKEN: ${{ secrets.UKC_TOKEN }} | |
KRAFTKIT_NO_CHECK_UPDATES: true | |
KRAFTKIT_LOG_LEVEL: debug | |
jobs: | |
integration: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test | |
id: test | |
uses: unikraft/kraftkit@staging | |
continue-on-error: true | |
with: | |
run: | | |
set -xe; | |
sudo apt-get -y update; | |
sudo apt-get install -y --no-install-recommends file grep; | |
cd node-playwright-chromium; | |
kraft cloud deploy \ | |
--no-start \ | |
--memory 4096 \ | |
--name node-playwright-chromium-${GITHUB_RUN_ID} \ | |
--runtime index.unikraft.io/official-testing/base-compat:latest \ | |
--subdomain node-playwright-chromium-${GITHUB_RUN_ID} \ | |
-p 443:8080 \ | |
.; | |
# wait for the instance to start | |
kraft cloud vm start -w 5s node-playwright-chromium-${GITHUB_RUN_ID}; | |
sleep 5; | |
curl -Lv --fail-with-body --max-time 10 --output screenshot.png "https://node-playwright-chromium-${GITHUB_RUN_ID}.${UKC_METRO}.kraft.host/?page=https://google.com" | |
file screenshot.png | grep -q PNG | |
- name: Cleanup | |
uses: unikraft/kraftkit@staging | |
if: always() | |
with: | |
run: | | |
set -xe; | |
kraft cloud vm stop node-playwright-chromium-${GITHUB_RUN_ID} || true; | |
kraft cloud vm logs node-playwright-chromium-${GITHUB_RUN_ID} || true; | |
kraft cloud vm rm node-playwright-chromium-${GITHUB_RUN_ID} || true; | |
kraft cloud img rm index.unikraft.io/test/node-playwright-chromium-${GITHUB_RUN_ID} || true; |