run tests on a container #11
This file contains 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: Playwright Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
SDK_TARGET_VERSION: | |
description: 'Target a specific SDK version. Otherwise latest' | |
required: false | |
push: | |
jobs: | |
test: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
container: | |
image: mcr.microsoft.com/playwright:v1.42.1-jammy | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Create env file | |
env: | |
API_TOKEN: ${{secrets.API_TOKEN}} | |
WORKFLOW_ID: ${{secrets.WORKFLOW_ID}} | |
SDK_TARGET_VERSION: ${{github.event.inputs.SDK_TARGET_VERSION}} | |
run: | | |
touch .env | |
echo API_TOKEN="$API_TOKEN" >> .env | |
echo WORKFLOW_ID="$WORKFLOW_ID" >> .env | |
- name: Install dependencies and build | |
run: npm ci && npm run build | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Run Playwright tests for studio integration | |
env: | |
IS_CLASSIC_INTEGRATION: 'false' | |
run: npm run e2e | |
- name: Run Playwright tests for classic integration | |
env: | |
IS_CLASSIC_INTEGRATION: 'true' | |
run: npm run e2e |