Skip to content

Commit

Permalink
chore: remove guides test and auth protected guides from docs (#4722)
Browse files Browse the repository at this point in the history
* chore: remove guides test and auth protected guides from docs

* update link checker
  • Loading branch information
thaddmt authored Nov 16, 2023
1 parent 4110586 commit ca86625
Show file tree
Hide file tree
Showing 32 changed files with 1 addition and 967 deletions.
95 changes: 0 additions & 95 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,101 +55,6 @@ jobs:
DOCSEARCH_DOCS_API_KEY: ${{ secrets.DOCSEARCH_DOCS_API_KEY }}
DOCSEARCH_DOCS_INDEX_NAME: ${{ secrets.DOCSEARCH_DOCS_INDEX_NAME }}

guides:
if: false # temporarily disable job
runs-on: ubuntu-latest
environment: ci
env:
NODE_ENV: test
strategy:
fail-fast: false
matrix:
include:
- path: ./guides/react/protected-routes
tags: '@guides and not @todo-guides'

steps:
- name: Checkout Amplify UI
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
persist-credentials: false

- name: Setup Node.js 20
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 https://github.com/actions/setup-node/commit/64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: 20
cache: 'yarn'
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2

- name: Restore cypress runner Cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 https://github.com/actions/cache/commit/88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
id: restore-cypress-cache
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

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

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 https://github.com/aws-actions/configure-aws-credentials/commit/e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
with:
aws-region: us-east-2
role-to-assume: ${{ secrets.AUTH_E2E_ROLE_ARN }}
# Amplify CLI does not support headless pull with temporary credentials
# when useProfile is false.
# See: https://github.com/aws-amplify/amplify-cli/issues/11009.
- name: Create temp AWS profile
run: |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && \
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && \
aws configure set aws_session_token $AWS_SESSION_TOKEN && \
aws configure set default.region $AWS_REGION
- name: Pull down AWS environments
run: yarn environments auth pull:email
- name: Delete AWS Profile
run: rm -rf ~/.aws

- name: Install guides
run: yarn install
working-directory: ${{ matrix.path }}

- name: Build guides
run: yarn build
working-directory: ${{ matrix.path }}

- name: Start guides site
run: yarn start & npx wait-on -c waitOnConfig.json -t 20000 http-get://localhost:3000
working-directory: ${{ matrix.path }}

- name: Run E2E tests against guides
run: yarn e2e test:guides
id: e2e
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 }}
- name: Upload videos and screenshots
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 https://github.com/actions/upload-artifact/commit/0b7f8abb1508181956e8e162db84b466c27e18ce
if: ${{ failure() && steps.e2e.outcome != 'success' }}
with:
name: guides-cypress-error
path: |
packages/e2e/cypress/videos/**
packages/e2e/cypress/screenshots/**
retention-days: 5

publish:
uses: aws-amplify/amplify-ui/.github/workflows/reusable-tagged-publish.yml@main
with:
Expand Down
1 change: 0 additions & 1 deletion docs/__tests__/__snapshots__/sitemap.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ exports[`Sitemap Snapshot 1`] = `
/react/getting-started/usage/nextjs,
/react/getting-started/usage/vite,
/react/guides,
/react/guides/auth-protected,
/react/guides/css-in-js,
/react/theming,
/react/theming/css-variables,
Expand Down
5 changes: 0 additions & 5 deletions docs/src/data/links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,6 @@ export const guides: ComponentNavItem[] = [
label: 'CSS in JS',
platforms: ['react', 'vue', 'angular'],
},
{
href: '/guides/auth-protected',
label: 'Protected Routes',
platforms: ['react'],
},
];

export const gettingStarted: ComponentNavItem[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Alert, Tabs } from '@aws-amplify/ui-react';
>
You must render the `Authenticator` UI component before using the `useAuthenticator` hook. This hook was designed to retrieve `Authenticator` UI specific state such as `route` and `user` and should not be used without the UI component.
<br/>
For a full example of `useAuthenticator`, see the [protected routes guide](../../guides/auth-protected)
</Alert>


Expand Down Expand Up @@ -39,7 +38,7 @@ const App = () => {

## Authenticator Provider

In advanced use cases where usage of the [`useAuthenticator` hook](advanced#useauthenticator-hook) outside the scope of the [`Authenticator`](../authenticator) is needed, wrap your application inside an `Authenticator.Provider`. The `Authenticator.Provider` guarantees that the [useAuthenticator hook](advanced#useauthenticator-hook) is available throughout your application. You can see an example of this pattern in the [Protected Routes Guide.](../../guides/auth-protected)
In advanced use cases where usage of the [`useAuthenticator` hook](advanced#useauthenticator-hook) outside the scope of the [`Authenticator`](../authenticator) is needed, wrap your application inside an `Authenticator.Provider`. The `Authenticator.Provider` guarantees that the [useAuthenticator hook](advanced#useauthenticator-hook) is available throughout your application.

<Tabs.Container defaultValue="Create React App">
<Tabs.List>
Expand Down
Loading

0 comments on commit ca86625

Please sign in to comment.