-
Notifications
You must be signed in to change notification settings - Fork 5
96 lines (96 loc) · 3.42 KB
/
run-acceptance-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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 ::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
- 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@v2
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 18.17.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
- name: Run lint
run: yarn run lint
build:
name: Build and Test
runs-on: ubuntu-latest
concurrency: build-and-test # Currently integration tests can clash across branches.
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
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: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 18.17.x
registry-url: https://registry.npmjs.org
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.20.x
- name: Install Yarn
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
- name: Install packages
run: yarn install
- name: Run build
run: yarn run build
- name: Run unit tests
run: yarn run test
- name: yarn link
run: pushd lib && yarn link && popd
- name: set script-shell
run: yarn config set script-shell /bin/bash
- name: Set up gotestfmt
uses: haveyoudebuggedit/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run examples
run: yarn run test-examples-gotestfmt
name: Run Acceptance Tests from PR
on:
repository_dispatch:
types: [run-acceptance-tests-command]
pull_request:
branches:
- main