Skip to content

examples/node-playwright-chromium (staging) #9

examples/node-playwright-chromium (staging)

examples/node-playwright-chromium (staging) #9

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: '0 4 * * 1-6' # Every work day at 4AM
# 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 60s 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;