chore(examples): update api-websocket-lambda-dynamodb example #148
Workflow file for this 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
env: | |
AWS_REGION: us-west-2 | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
PULUMI_API: https://api.pulumi-staging.io | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
jobs: | |
comment-notification: | |
# We only care about adding the result to the PR if it's a repository_dispatch event | |
if: github.event_name == 'repository_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create URL to the run output | |
id: vars | |
run: echo run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID >> "$GITHUB_OUTPUT" | |
- name: Update with Result | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | |
issue-number: ${{ github.event.client_payload.github.payload.issue.number }} | |
body: | | |
Please view the PR build - ${{ steps.vars.outputs.run-url }} | |
lint: | |
name: Run lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Unshallow clone for tags | |
run: git fetch --prune --unshallow --tags | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.19.x | |
registry-url: https://registry.npmjs.org | |
- name: Install Yarn | |
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 | |
- name: Install packages | |
run: yarn install --frozen-lockfile | |
- name: Run lint | |
run: yarn run lint | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Install pulumictl | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: pulumi/pulumictl | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.19.x | |
registry-url: https://registry.npmjs.org | |
- name: Install Yarn | |
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 | |
- name: Install packages | |
run: yarn install --frozen-lockfile | |
- name: Run build | |
run: yarn run build | |
- name: Run unit tests | |
run: yarn run test | |
test: | |
name: acceptance-test | |
concurrency: | |
group: acceptance-test-${{ matrix.index }} # TODO: concurrent tests across PRs can cause problems | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Install pulumictl | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: pulumi/pulumictl | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-region: ${{ env.AWS_REGION }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
role-duration-seconds: 3600 | |
role-session-name: ${{ env.PROVIDER }}@githubActions | |
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.19.x | |
registry-url: https://registry.npmjs.org | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
cache-dependency-path: examples/*.sum | |
- name: Install Yarn | |
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 | |
- name: Install packages | |
run: yarn install --frozen-lockfile | |
- name: Run build | |
run: yarn run build | |
- name: yarn link | |
run: pushd lib && yarn link && popd | |
- name: set script-shell | |
run: yarn config set script-shell /bin/bash | |
- name: Install gotestsum | |
run: go install gotest.tools/gotestsum@latest | |
- name: Generate go test Slice | |
id: test_split | |
uses: hashicorp-forge/[email protected] | |
with: | |
working-directory: examples | |
flags: "-timeout 30m" | |
total: ${{ matrix.parallel }} | |
index: ${{ matrix.index }} | |
- name: Run examples | |
run: cd examples && gotestsum --format github-actions -- -v -count=1 -timeout 2h -parallel 4 -run "${{ steps.test_split.outputs.run }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
parallel: [3] | |
index: [0, 1, 2] | |
name: Run Acceptance Tests from PR | |
on: | |
repository_dispatch: | |
types: [run-acceptance-tests-command] | |
pull_request: | |
branches: | |
- main |