Skip to content

Commit 2739347

Browse files
Andersincorbador
andauthored
run playgrounds in playwright (#536)
* wip * Add post-login-wv * Before switching to aws-amplify * Switch to Amplify done * prettier * Fix build * Change wv auth * Add connectToken endpoint (connect-next playground) * Add connectTokenExternal route * Add static well-known for connect-next playground * start react playground in playwright * run web-js and web-js-script playgrounds in playwright * update workflows * prettier * install playground deps in the beginning of playwright test * install root dependencies for test stage * unique cache step id * remove root build from playwright (assume it's already done in local or CI * remove unused function * remove unnecessary cache step * clean up stdout * rpid is localhost * Extend wv-connect-token endpoint with simulation capas * Add log * run playground in connect playwright * rename workflow file * remove comments * remove comments * recover connect tests * matrix complete and connect tests * move env vars out of matrix * configure playground connect secrets for ci e2e test pipeline * remove outdated workflow * prettier * debug logs for playground in playwright * install connect playground deps * disable next cache for concurrent connect playground builds * build on global setup * rever cache disable * fix github secret env vars * change useragent * use proper github secret name * ignore playground app logs in playwright * build playground on playwright global setup instead of building before every test group * use correct configs for nightly connect tests * prettier * remove unused command * change remaining vercel URLs to localhost * abstract playground url out as env var * prettier * modify nightly test workflow file * change readme * add more randomness to logstream name * Add assetlinks * Prettier * Refactor connect tests (first passing test) * Refactor connect complete * Remove external endpoint * Missing ENVs for flow * Correct NEXT_PUBLIC_AWS_COGNITO_CLIENT_ID --------- Co-authored-by: Incorbador <[email protected]> Co-authored-by: Martin Kellner <[email protected]>
1 parent 29f32bc commit 2739347

File tree

123 files changed

+11849
-3796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+11849
-3796
lines changed

.github/workflows/deploy-playground-and-test.yml

Lines changed: 0 additions & 283 deletions
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Deploy Playground Apps to Vercel
2+
env:
3+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
4+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5+
BRANCH_NAME_RAW: ${{ github.head_ref || github.ref_name }}
6+
7+
on:
8+
pull_request:
9+
push:
10+
branches:
11+
- develop
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-24.04
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
24+
- name: Cache node modules
25+
id: cache-npm
26+
uses: actions/cache@v3
27+
env:
28+
cache-name: cache-node-modules
29+
with:
30+
path: |
31+
~/.npm
32+
./node_modules
33+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}-force-1
34+
restore-keys: |
35+
${{ runner.os }}-build-${{ env.cache-name }}-
36+
${{ runner.os }}-build-
37+
${{ runner.os }}-
38+
39+
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
40+
name: Install Dependencies
41+
run: |
42+
npm i
43+
npm install lerna
44+
npm install [email protected]
45+
npm list
46+
47+
- name: Check ESLint Errors
48+
run: npm run lint
49+
50+
- name: Check Prettier Formatting
51+
run: npm run prettier:check
52+
53+
- name: Build SDKs
54+
run: |
55+
npm run build
56+
npm run build:bundler:local
57+
58+
- name: Normalize branch name
59+
run: |
60+
echo "BRANCH_NAME=$(echo $BRANCH_NAME_RAW | tr '/_' '-')" >> "$GITHUB_ENV"
61+
shell: bash
62+
63+
- name: Deploy react playground to Vercel
64+
run: |
65+
npx vercel link --yes --project react-playground --scope corbado -t $VERCEL_TOKEN
66+
npx vercel pull -t $VERCEL_TOKEN
67+
npx vercel build -t $VERCEL_TOKEN
68+
url="$(npx vercel deploy --prebuilt -t ${{ secrets.VERCEL_TOKEN }})"
69+
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.react.playground.corbado.io
70+
env:
71+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_REACT_PLAYGROUND }}
72+
73+
- name: Deploy connect next playground to Vercel
74+
run: |
75+
npx vercel link --yes --project connect-next-playground --scope corbado -t $VERCEL_TOKEN
76+
npx vercel pull --environment=preview -t $VERCEL_TOKEN
77+
npx vercel build -t $VERCEL_TOKEN
78+
url="$(npx vercel deploy --prebuilt -t ${{ secrets.VERCEL_TOKEN }})"
79+
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.connect-next.playground.corbado.io
80+
env:
81+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_CONNECT_NEXT_PLAYGROUND }}
82+
83+
- name: Deploy web-js playground to Vercel
84+
run: |
85+
npx vercel link --yes --project web-js-playground --scope corbado -t $VERCEL_TOKEN
86+
npx vercel pull -t $VERCEL_TOKEN
87+
npx vercel build -t $VERCEL_TOKEN
88+
url="$(npx vercel deploy --prebuilt -t ${{ secrets.VERCEL_TOKEN }})"
89+
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.web-js.playground.corbado.io
90+
env:
91+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_WEB_JS_PLAYGROUND }}
92+
93+
- name: Deploy web-js-script playground to Vercel
94+
run: |
95+
npx vercel link --yes --project web-js-script-playground --scope corbado -t $VERCEL_TOKEN
96+
npx vercel pull -t $VERCEL_TOKEN
97+
npx vercel build -t $VERCEL_TOKEN
98+
url="$(npx vercel deploy --prebuilt -t ${{ secrets.VERCEL_TOKEN }})"
99+
npx vercel alias -S corbado -t ${{ secrets.VERCEL_TOKEN }} "$url" $BRANCH_NAME.web-js-script.playground.corbado.io
100+
env:
101+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_WEB_JS_SCRIPT_PLAYGROUND }}
102+

0 commit comments

Comments
 (0)