Skip to content

Commit

Permalink
test e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Sridhar committed Jun 27, 2023
1 parent c1fa9c7 commit a7f2dbe
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/callable-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
workflow_call:
secrets:
GH_PAT:
required: true

env:
NPM_REGISTRY: http://localhost:4873/
NPM_USER: circleci
NPM_PASS: circleci
NPM_EMAIL: [email protected]

jobs:
e2e-tests:
name: Runs E2E tests
runs-on: ubuntu-latest

strategy:
matrix:
BROWSER: [chrome]
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
# Minimal depth 2 so we can checkout the commit before possible merge commit.
fetch-depth: 2
path: aws-amplify
- name: Setup node and build the repository
uses: ./.github/actions/node-and-build
- name: Setup samples staging repository
uses: ./.github/actions/setup-samples-staging
with:
GH_PAT: ${{ secrets.GH_PAT }}
- name: Load Verdaccio with AmplifyJs
uses: ./.github/actions/load-verdaccio-with-amplify-js
- name: Run E2E test
run: |
../aws-amplify/.circleci/retry-yarn-script.sh -s 'ci:test react storage storageApp storage ${{ matrix.BROWSER }}'
working-directory: ./aws-amplify-staging
shell: bash
49 changes: 49 additions & 0 deletions .github/workflows/callable-integ.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test

# on: [push]
on:
push:
branches:
- 'test'

jobs:
read-config:
runs-on: ubuntu-latest
outputs:
integ-config: ${{env.INTEG_CONFIG}}
steps:
- uses: actions/checkout@v2
- name: final test
run: echo "INTEG_CONFIG=$(cat .github/workflows/integ-config/*.yml | yq -o=json | jq -c .)" >> $GITHUB_ENV

cypress:
name: Cypress Tests
needs: read-config
runs-on: ubuntu-latest
strategy:
matrix:
BROWSER: [chrome]
integ-config: ${{ fromJson(needs.read-config.outputs.integ-config) }}
steps:
- name: Checkout repo
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: 16
cache: 'yarn'
build: npm run build
start: npm start
wait-on: 'http://localhost:3000'
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 50
- name: Install dependencies
run: yarn
- name: run the integ test
run: |
yarn ci:test \
${{ matrix.integ-config.framework }} \
${{ matrix.integ-config.category }} \
${{ matrix.integ-config.sample_name }} \
${{ matrix.integ-config.spec }} \
${{ matrix.BROWSER }} \
9 changes: 9 additions & 0 deletions .github/workflows/integ-config/auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# angular
- framework: angular
category: auth
sample_name: amplify-authenticator
spec: ui-amplify-authenticator
# - framework: angular
# category: auth
# sample_name: amplify-authenticator
# spec: custom-authenticator
5 changes: 5 additions & 0 deletions .github/workflows/integ-config/datastore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# React
- framework: react
category: datastore
sample_name: many-to-many
spec: many-to-many
10 changes: 10 additions & 0 deletions .github/workflows/integ-config/interactions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Angular
- framework: angular
category: interactions
sample_name: chatbot-component
spec: chatbot-component
# # React
# - framework: react
# category: interactions
# sample_name: chatbot-component
# spec: chatbot-component
40 changes: 40 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PR Validation

on: [push]

jobs:
prebuild:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
# Minimal depth 2 so we can checkout the commit before possible merge commit.
fetch-depth: 2
path: aws-amplify
- name: Setup node and build the repository
uses: ./aws-amplify/.github/actions/node-and-build
e2e:
needs: prebuild
uses: ./.github/workflows/callable-e2e.yml

# get-package-list:
# uses: ./.github/workflows/callable-get-package-list.yml
# codeql:
# uses: ./.github/workflows/callable-codeql.yml

# unit-tests:
# needs:
# - prebuild
# - get-package-list
# strategy:
# matrix:
# package: ${{ fromJSON(needs.get-package-list.outputs.packages) }}
# fail-fast: true
# uses: ./.github/workflows/callable-unit-tests.yml
# with:
# package: ${{ matrix.package }}

# bundle-size-tests:
# needs: prebuild
# uses: ./.github/workflows/callable-bundle-size-tests.yml

0 comments on commit a7f2dbe

Please sign in to comment.