-
-
Notifications
You must be signed in to change notification settings - Fork 19
74 lines (70 loc) · 2.96 KB
/
node-e2e.yml
File metadata and controls
74 lines (70 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Test E2E CI
on:
workflow_dispatch:
inputs:
vercelId:
required: true
default: 'github56'
description: 'Test UrlId'
e2eId:
required: true
default: 'sauce'
description: 'Testing Provider (sauce / browserstack)'
testPattern:
required: true
default: '*'
description: 'Testing Pattern regex'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x] # Add support for 12.x, 15.x later just build and unit tests
steps:
- uses: actions/checkout@v2
- name: Run E2E Test ${{ matrix.node-version }}
continue-on-error: true
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: rm -rf package.json && mv wdio-package.json package.json && npm install && npm run install-react-mui
#- name: "Check if deployment is done"
#env:
# VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}
# VERCEL_API: ${{secrets.VERCEL_API}}
#run : |
# isReadyState()
# {
# GIT_SHA=$(git log -1 --pretty=%B | grep ^Merge | cut -d " " -f 2)
# VERCEL_STATE=$(curl -H "$VERCEL_TOKEN" "$VERCEL_API$GIT_SHA" | jq -r '.deployments[0].state')
# if [ $VERCEL_STATE = "READY" ]; then
# echo Valid state $VERCEL_STATE
# elif [ $VERCEL_STATE = "ERROR" ]; then
# echo InValid state $VERCEL_STATE 1>&2
# exit 64
# elif [ $VERCEL_STATE = "null" ]; then
# echo InValid state $VERCEL_STATE 1>&2
# exit 64
# else
# echo invalid state found - $VERCEL_STATE
# isReadyState
# fi
# }
# isReadyState
#- run: |
# GIT_SHA=$(git log -1 --pretty=%B | grep ^Merge | cut -d " " -f 2)
# VERCEL_URI=$(curl -H "$VERCEL_TOKEN" "$VERCEL_API$GIT_SHA" | jq -r '.deployments[0].url')
# echo ${VERCEL_URI} for ${GITHUB_SHA} with ${GIT_SHA} - ${GITHUB_REF} - ${GITHUB_HEAD_REF} - ${VERCEL_API}
# VERCEL_URL="https://${VERCEL_URI}" npm run test:e2e:ci
- name: "Run E2E Tests"
run: VERCEL_URL="https://react-jsonschema-form-material-ui-${{ github.event.inputs.vercelId }}.vercel.app" npm run test:e2e:${{ github.event.inputs.e2eId }}:ci
env:
BROWSERSTACK_USER: ${{secrets.BROWSERSTACK_USER}}
BROWSERSTACK_ACCESSKEY: ${{secrets.BROWSERSTACK_ACCESSKEY}}
SAUCE_USER: ${{secrets.SAUCE_USER}}
SAUCE_ACCESSKEY: ${{secrets.SAUCE_ACCESSKEY}}
VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}
VERCEL_API: ${{secrets.VERCEL_API}}
TEST_PATTERNS: ${{ github.event.inputs.testPattern }}