forked from aws-amplify/amplify-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sridhar
committed
Jun 28, 2023
1 parent
3828d82
commit b448320
Showing
4 changed files
with
129 additions
and
66 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: 'E2E Tests' | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package: | ||
required: true | ||
type: string | ||
test_name: | ||
required: true | ||
type: string | ||
framework: | ||
required: true | ||
type: string | ||
category: | ||
required: true | ||
type: string | ||
sample_name: | ||
required: true | ||
type: string | ||
spec: | ||
# optional - the script will use sample_name by default | ||
type: string | ||
default: '' | ||
browser: | ||
type: string | ||
default: '' | ||
amplifyjs_dir: | ||
# optional - dir to amplify js workspace | ||
type: string | ||
default: '' | ||
|
||
jobs: | ||
unit_test: | ||
name: Unit Tests - ${{ inputs.package }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install ${{ inputs.test_name }} >> sample | ||
run: | | ||
echo "Current NPM registry: " $(yarn config get registry) | ||
~/amplify-js/.circleci/retry-yarn-script.sh -s 'install' -n 3 | ||
- name: Run cypress tests for ${{ inputs.test_name }} sample on dev | ||
run: | | ||
cd ~/amplify-js-samples-staging | ||
~/amplify-js/.circleci/retry-yarn-script.sh -s \ | ||
'ci:test ${{ inputs.framework }} \ | ||
${{ inputs.category }} \ | ||
${{ inputs.sample_name }} \ | ||
${{ inputs.spec }} \ | ||
${{ inputs.browser }} \ | ||
dev \ | ||
${{ inputs.amplifyjs_dir }}' -n 3 | ||
- name: Run cypress tests for ${{ inputs.test_name }} sample on prod | ||
run: | | ||
cd ~/amplify-js-samples-staging | ||
~/amplify-js/.circleci/retry-yarn-script.sh -s \ | ||
'ci:test ${{ inputs.framework }} \ | ||
${{ inputs.category }} \ | ||
${{ inputs.sample_name }} \ | ||
${{ inputs.spec }} \ | ||
${{ inputs.browser }} \ | ||
prod \ | ||
${{ inputs.amplifyjs_dir }}' -n 3 | ||
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 https://github.com/actions/upload-artifact/commit/0b7f8abb1508181956e8e162db84b466c27e18ce | ||
with: | ||
name: my-artifact | ||
path: | | ||
~/amplify-js-samples-staging/cypress/videos | ||
~/amplify-js-samples-staging/cypress/screenshots |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,66 +14,54 @@ jobs: | |
e2e-tests: | ||
name: Runs E2E tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
BROWSER: [chrome, firefox] | ||
BROWSER: [chrome] | ||
steps: | ||
- name: Where we at? | ||
run: | | ||
pwd | ||
ls | ||
- 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: Where we at? | ||
run: | | ||
pwd | ||
ls | ||
- name: Setup node and build the repository | ||
uses: ./aws-amplify/.github/actions/node-and-build | ||
# - 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 | ||
|
||
- name: Checkout staging repo | ||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f | ||
with: | ||
repository: ashwinkumar6/amplify-js-samples-staging | ||
path: aws-amplify-staging | ||
token: ${{ secrets.GH_PAT }} | ||
fetch-depth: 2 | ||
- name: Where we at? | ||
run: | | ||
pwd | ||
ls | ||
- name: Prepare staging repo | ||
run: | | ||
yarn | ||
working-directory: ./aws-amplify-staging | ||
|
||
- name: Start verdaccio | ||
run: | | ||
npx [email protected] & | ||
sleep 15 # TODO waits until verdaccio is up and running | ||
# - name: Start verdaccio | ||
# run: | | ||
# npx [email protected] & | ||
# sleep 15 # TODO waits until verdaccio is up and running | ||
|
||
- name: Publish to verdaccio | ||
run: | | ||
pwd | ||
ls | ||
npm i -g npm-cli-adduser | ||
npm-cli-adduser | ||
sleep 1 | ||
yarn config set registry $NPM_REGISTRY | ||
npm set registry $NPM_REGISTRY | ||
git config --global user.email $NPM_EMAIL | ||
git config --global user.name $NPM_USER | ||
git status | ||
git --no-pager diff | ||
.circleci/retry-yarn-script.sh -s publish:verdaccio -n 5 -r true | ||
yarn info aws-amplify@unstable description | ||
npm info aws-amplify@unstable version | ||
working-directory: ./aws-amplify | ||
shell: bash | ||
# - name: Publish to verdaccio | ||
# run: | | ||
# pwd | ||
# ls | ||
# npm i -g npm-cli-adduser | ||
# npm-cli-adduser | ||
# sleep 1 | ||
# yarn config set registry $NPM_REGISTRY | ||
# npm set registry $NPM_REGISTRY | ||
# git config --global user.email $NPM_EMAIL | ||
# git config --global user.name $NPM_USER | ||
# git status | ||
# git --no-pager diff | ||
# .circleci/retry-yarn-script.sh -s publish:verdaccio -n 5 -r true | ||
# yarn info aws-amplify@unstable description | ||
# npm info aws-amplify@unstable version | ||
# working-directory: ./aws-amplify | ||
# shell: bash | ||
|
||
- name: Run E2E test | ||
run: | | ||
|
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