Skip to content

feat: allow configurable tokens in nextjs app example #1165

feat: allow configurable tokens in nextjs app example

feat: allow configurable tokens in nextjs app example #1165

Workflow file for this run

name: Build
on:
pull_request:
branches: [main]
jobs:
verify:
runs-on: macos-latest
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Verify README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: stable
project_type: sdk
sdk_language: JavaScript
dev_docs_slug: nodejs
multiple_sdks: true
- name: Verify README generation for nodejs
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: stable
project_type: sdk
sdk_language: Node.js
dev_docs_slug: nodejs
template_file: ./packages/client-sdk-nodejs/README.template.md
output_file: ./packages/client-sdk-nodejs/README.md
- name: Verify README generation for web
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v2
with:
project_status: official
project_stability: stable
project_type: sdk
sdk_language: "JavaScript Web"
dev_docs_slug: web
template_file: ./packages/client-sdk-web/README.template.md
output_file: ./packages/client-sdk-web/README.md
- name: Commitlint and Other Shared Build Steps
uses: momentohq/standards-and-practices/github-actions/shared-build@gh-actions-v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
strategy:
matrix:
node: [18]
name: Test on Node ${{ matrix.node }}
runs-on: macos-latest
env:
TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
TEST_LEGACY_AUTH_TOKEN: ${{ secrets.ALPHA_LEGACY_TEST_AUTH_TOKEN }}
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Build and test all packages
run: |
node -v
./scripts/build-and-test-all-packages.sh
- name: Run auth tests for packages
run: |
node -v
./scripts/test-auth-packages.sh
test-examples:
strategy:
matrix:
node: [14, 16, 18]
name: Test examples on node ${{ matrix.node }}
runs-on: macos-latest
env:
# TODO: remove token stored as secret in favor of using a
# momento-local instance that can be spun up for testing
MOMENTO_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install Deps and Build
id: validation
continue-on-error: true
run: |
pushd examples/nodejs/cache
npm ci
npm run build
npm run validate-examples
popd
pushd examples/nodejs/observability
npm ci
npm run build
npm run validate-examples
popd
pushd examples/nodejs/load-gen
npm ci
npm run build
popd
pushd examples/nodejs/topics
npm ci
npm run build
popd
pushd examples/nodejs/lambda-examples/topics-microservice
npm ci
npm run build
popd
pushd examples/nodejs/mongodb-examples/simple-read-aside
npm ci
npm run build
popd
pushd examples/nodejs/access-control
npm ci
npm run build
npm run validate-examples
popd
pushd examples/nodejs/aws
npm ci
npm run build
popd
- name: Send CI failure mail
if: ${{ steps.validation.outcome == 'failure' }}
uses: momentohq/standards-and-practices/github-actions/error-email-action@gh-actions-v2
with:
username: ${{secrets.MOMENTO_ROBOT_GMAIL_USERNAME}}
password: ${{secrets.MOMENTO_ROBOT_GMAIL_PASSWORD}}
- name: Flag Job Failure
if: ${{ steps.validation.outcome == 'failure' }}
run: exit 1
test-web-examples:
strategy:
matrix:
node: [ 16, 18 ]
name: Test web examples on node ${{ matrix.node }}
runs-on: macos-latest
env:
# TODO: remove token stored as secret in favor of using a
# momento-local instance that can be spun up for testing
MOMENTO_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install Deps and Build
id: validation
continue-on-error: true
run: |
pushd examples/web/cache
npm ci
npm run build
npm run validate-examples
popd
- name: Send CI failure mail
if: ${{ steps.validation.outcome == 'failure' }}
uses: momentohq/standards-and-practices/github-actions/error-email-action@gh-actions-v2
with:
username: ${{secrets.MOMENTO_ROBOT_GMAIL_USERNAME}}
password: ${{secrets.MOMENTO_ROBOT_GMAIL_PASSWORD}}
- name: Flag Job Failure
if: ${{ steps.validation.outcome == 'failure' }}
run: exit 1