Skip to content

Commit

Permalink
Docs release - 04/20 (#1731)
Browse files Browse the repository at this point in the history
* Added new React Guide for Authenticated Routes (#1675)

* Began work on new guides for auth

* Added React guide

* Updated guide

* capitilization update

* Addex Example Wrapper

Co-authored-by: Erik Hanchett <ehhanche@amazon.com>

* chore: align typescript version at root devDependencies (#1686)

* Fixed issue with vue examples (#1688)

Co-authored-by: Erik Hanchett <ehhanche@amazon.com>

* chore: use tsup for dev build (#1690)

* feat(Authenticator): accept general JSX children (#1685)

* Allow non-function children in Authenticator

* Create six-bikes-develop.md

* Update six-bikes-develop.md

* Update packages/react/src/components/Authenticator/Router/index.tsx

Co-authored-by: Caleb Pollman <cpollman@amazon.com>

* Update packages/react/src/components/Authenticator/Router/index.tsx

* Use React.ReactNode and consolidate children type

* Reduce nested ternary

* Add fragments around children

* Fix comments

* Update .changeset/six-bikes-develop.md

Co-authored-by: Caleb Pollman <cpollman@amazon.com>

Co-authored-by: Caleb Pollman <cpollman@amazon.com>

* fix: update focus styling for switchField  (#1667)

* fix: update focus styling for switchField

Co-authored-by: Heather Buchel <buchel@amazon.com>

* chore: update required permissions for publish-latest (#1708)

* docs: add section on token definition structure (#1671)

* docs: add section on token definition structure

Co-authored-by: Heather Buchel <buchel@amazon.com>
Co-authored-by: Scott Rees <6165315+reesscot@users.noreply.github.com>

* chore: (docs) update tabs component demo (#1703)

* chore: (docs) update tabs component demo

Co-authored-by: Heather Buchel <buchel@amazon.com>

* fix(docs Authenticator): Update style authenticator (#1707)

* Updated docs for styling for authenticator

* fixed it so only React sees information about provider

Co-authored-by: Erik Hanchett <ehhanche@amazon.com>

* chore: updating docs build to respect yarn.lock (#1714)

* chore: updating docs build to respect yarn.lock

* chore: adding resolution to clear cache

* Update tests.yml (#1715)

* chore: removing dep resolution

Co-authored-by: William Lee <43682783+wlee221@users.noreply.github.com>

* docs: fixing controlled example bug (#1716)

* docs: fixing dark mode example (#1719)

* docs: update Pagination (#1695)

* refactoring main pagination demo

* more pagination examples

* pagination styling examples

* adjust styles

* demonstrate usePagination hook, and include Theme example for styling

* remove extra backticks

* remove empty code section

Co-authored-by: Joe Buono <joebuono@amazon.com>

* chore: update menu demo to new format (#1702)

* fix(docs): Fix anchor tags between pages (#1706)

* Split off tests to `test-main` and `test-prs` (#1697)

* Split off tests to `test-main` and `test-prs`

* Adjust workflow names

* Add comments

* Skip cache for docs

* chore(ui-react): add jest generated coverage directory to .gitignore (#1718)

* chore: Bump maplibre-gl-js-amplify dependency version (#1721)

* Bump maplibre-gl-js-amplify dependency version

* Create patch changeset for version bump

* chore(bump map libre) (#1722)

* Bump maplibre

* Added changeset

* Added yarn lock

Co-authored-by: Erik Hanchett <ehhanche@amazon.com>

* docs: updating Link docs (#1709)

* docs: updating Link docs

* chore: addressing comments

* docs(fix): remove Theme tab from demos (#1723)

* temporarily remove Theme tab from docs demos

* removed nullish coalescing operator

* small typo

Co-authored-by: Joe Buono <joebuono@amazon.com>

* chore(ui-react): type withAuthenticator (#1724)

* chore: fixing workflow not publishing to next tag (#1725)

* chore: fixing workflow not publishing to next tag

* chore: updating workflow

* chore: updating publish-geo

* chore: update view demo to new format (#1710)

* Version Packages (#1693)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs: updating placeholder docs (#1705)

* docs: updating placeholder docs

* docs: adding Theme section

* chore: addressing comments

Co-authored-by: Erik Hanchett <icystorm@gmail.com>
Co-authored-by: Erik Hanchett <ehhanche@amazon.com>
Co-authored-by: Scott Rees <6165315+reesscot@users.noreply.github.com>
Co-authored-by: William Lee <43682783+wlee221@users.noreply.github.com>
Co-authored-by: Caleb Pollman <cpollman@amazon.com>
Co-authored-by: Heather Buchel <hbuchel@gmail.com>
Co-authored-by: Heather Buchel <buchel@amazon.com>
Co-authored-by: Joe Buono <joebuono724@gmail.com>
Co-authored-by: Joe Buono <joebuono@amazon.com>
Co-authored-by: Shane Laymance <shane.laymance@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
13 people authored Apr 20, 2022
1 parent eff5e83 commit 04fb8f2
Show file tree
Hide file tree
Showing 100 changed files with 2,535 additions and 1,124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-geo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish to @geo

on:
workflow_run:
workflows: ['Tests']
workflows: ['Test / main']
types:
- completed

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches: [main]

permissions:
contents: write # Used to commit to "Version Packages" PR
pull-requests: write # Used to create "Version Packages" PR
# Other permissions are defaulted to none

jobs:
publish:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish to @next

on:
workflow_run:
workflows: ['Tests']
workflows: ['Test / main']
types:
- completed

Expand Down
302 changes: 302 additions & 0 deletions .github/workflows/test-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
# This workflow will run unit, e2e, and docs tests on commits to main.

name: Test / main

concurrency:
group: e2e-${{ github.sha }}
cancel-in-progress: true

on:
push:
branches: [main, ui-svelte/main, ui-geo/main]

permissions:
pull-requests: write # used to remove label
# other permissions are defaulted to "none"

jobs:
setup:
runs-on: ubuntu-latest
outputs:
ref: ${{ steps.get-ref.outputs.ref }}
commit: ${{ steps.get-ref.outputs.commit }}
steps:
- name: Get ref and commit
id: get-ref
run: |
echo "::set-output name=ref::${{ github.ref }}"
echo "::set-output name=commit::${{ github.sha }}"
- name: Checkout Amplify UI
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js LTS
uses: actions/setup-node@v2
with:
node-version: lts/*
cache: 'yarn'
- name: Install packages
run: yarn --no-lockfile
- name: Build ui package
run: yarn ui build
- name: Cache cypress runner
uses: actions/cache@v2
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}
- name: Cache packages/ui/dist
uses: actions/cache@v2
with:
path: ./packages/ui/dist
key: ${{ runner.os }}-ui-${{ steps.get-ref.outputs.commit }}
- name: Cache node_modules
uses: actions/cache@v2
with:
path: |
./node_modules
**/node_modules
key: ${{ runner.os }}-nodemodules-${{ steps.get-ref.outputs.commit }}
unit:
needs: setup
runs-on: ubuntu-latest
env:
NODE_ENV: test

strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
package:
- ui
- angular
- vue
- react

steps:
- name: Checkout Amplify UI
uses: actions/checkout@v2
with:
ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
persist-credentials: false

- name: Setup Node.js LTS
uses: actions/setup-node@v2
with:
node-version: lts/*
cache: 'yarn'

- name: Restore node_modules cache
uses: actions/cache@v2
id: restore-cache
with:
path: |
./node_modules
**/node_modules
key: ${{ runner.os }}-nodemodules-${{ needs.setup.outputs.commit }}

- name: Restore ui/dist cache
uses: actions/cache@v2
id: restore-ui-cache
with:
path: ./packages/ui/dist
key: ${{ runner.os }}-ui-${{ needs.setup.outputs.commit }}

- name: Install packages
if: steps.restore-cache.outputs.cache-hit != 'true'
run: yarn --no-lockfile

- name: Build ui package
if: ${{ steps.restore-ui-cache.outputs.cache-hit != 'true' && matrix.package != 'ui' }}
run: yarn ui build

- name: Build ${{ matrix.package }} package
if: ${{ matrix.package != '@aws-amplify/ui' }}
run: yarn ${{ matrix.package }} build

- name: Cache ${{ matrix.package }}/dist
uses: actions/cache@v2
with:
path: ./packages/${{ matrix.package }}/dist
key: ${{ runner.os }}-${{ matrix.package }}-${{ needs.setup.outputs.commit }}

- name: Lint packages
run: yarn ${{ matrix.package }} lint

- name: Run ${{ matrix.package }} tests
run: yarn ${{ matrix.package }} test

e2e:
# Only run e2e tests if unit tests pass
needs: [setup, unit]
runs-on: ubuntu-latest
environment: ci
env:
NODE_ENV: test

strategy:
# Run each examples (e.g. `next-example`) which uses a library (e.g. `@aws-amplify/ui-react`)
# BUT, Exclude `@skip` tests in `main` and exclude `@todo-${{ package }}` tests in PRs
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-environment-variables-in-a-matrix
matrix:
include:
- example: angular
package: angular
tags: '@angular and not (@skip or @todo-angular)'

- example: next
package: react
tags: '@react and not (@skip or @todo-react)'

- example: vue
package: vue
tags: '@vue and not (@skip or @todo-vue)'

steps:
- name: Checkout Amplify UI
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Next.js Cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}

- name: Setup Node.js LTS
uses: actions/setup-node@v2
with:
node-version: lts/*
cache: 'yarn'

- name: Restore cypress runner Cache
uses: actions/cache@v2
id: restore-cypress-cache
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}

- name: Restore node_modules cache
uses: actions/cache@v2
id: restore-cache
with:
path: |
./node_modules
**/node_modules
key: ${{ runner.os }}-nodemodules-${{ needs.setup.outputs.commit }}

- name: Restore ui/dist cache
uses: actions/cache@v2
id: restore-ui-cache
with:
path: ./packages/ui/dist
key: ${{ runner.os }}-ui-${{ needs.setup.outputs.commit }}

- name: Restore ${{ matrix.package }}/dist cache
id: restore-package-cache
uses: actions/cache@v2
with:
path: ./packages/${{ matrix.package }}/dist
key: ${{ runner.os }}-${{ matrix.package }}-${{ needs.setup.outputs.commit }}

- name: Install packages
if: steps.restore-cache.outputs.cache-hit != 'true' || steps.restore-cypress-cache.outputs.cache-hit != 'true'
run: yarn --no-lockfile

- name: Build @aws-amplify/ui package
if: steps.restore-ui-cache.outputs.cache-hit != 'true'
run: yarn ui build

- name: Build ${{ matrix.package }} package
if: steps.restore-package-cache.outputs.cache-hit != 'true'
run: yarn ${{ matrix.package }} build

- name: Add Amplify CLI
run: yarn global add @aws-amplify/cli

- name: Get CLI versions
id: cli-version
run: echo "::set-output name=version::$(amplify --version)"

- name: Create or restore environments cache
id: environments-cache
uses: actions/cache@v2
with:
path: environments/**/aws-exports.js
key: ${{ runner.os }}-environments-${{ steps.cli-version.outputs.version }}-${{ hashFiles('environments/**/amplify/**') }}

- name: Pull down AWS environments on cache miss
if: steps.environments-cache.outputs.cache-hit != 'true'
run: yarn environments pull
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Build ${{ matrix.example }} example
run: yarn workspace ${{ matrix.example }}-example build

- name: Start ${{ matrix.example }} example
run: yarn workspace ${{ matrix.example }}-example start & npx wait-on -c waitOnConfig.json -t 20000 http-get://localhost:3000/ui/components/authenticator/sign-in-with-username

- name: Run E2E tests against ${{ matrix.example }} example
run: yarn workspace e2e test:examples
env:
# Override on the default value in `cypress.json` with framework-specific tag
TAGS: '${{ matrix.tags }}'

# Env values for testing flows
DOMAIN: ${{ secrets.DOMAIN }}
PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
USERNAME: ${{ secrets.USERNAME }}
NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
docs:
# Only run docs tests if e2e tests pass
needs: [setup, unit]
runs-on: ubuntu-latest
environment: ci
env:
NODE_ENV: test
steps:
- name: Checkout Amplify UI
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Setup Node.js LTS
uses: actions/setup-node@v2
with:
node-version: lts/*
cache: 'yarn'

- name: Restore cypress runner Cache
uses: actions/cache@v2
id: restore-cypress-cache
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}

- name: Install packages
run: yarn install

- name: Build ui package
run: yarn ui build

- name: Build react package
run: yarn react build

- name: Build docs package
run: yarn docs build

- name: Start docs site
run: yarn docs start & npx wait-on -c waitOnConfig.json -t 20000 http-get://localhost:3000

- name: Run E2E tests against docs
run: yarn workspace e2e test:theme
env:
# Env values for testing flows
DOMAIN: ${{ secrets.DOMAIN }}
PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
USERNAME: ${{ secrets.USERNAME }}
NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
Loading

0 comments on commit 04fb8f2

Please sign in to comment.