-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 1.77 KB
/
pull_request.yaml
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
name: Run tests on Branch
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
run-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm test
deploy-ephemeral:
uses: ./.github/workflows/serverless-deploy.yaml
needs: run-unit-tests
permissions:
id-token: write
contents: read
secrets:
AWS_DEPLOYER_ROLE: ${{ secrets.AWS_DEPLOYER_ROLE }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
with:
ENVIRONMENT: ${{ github.actor }}-${{ github.event.pull_request.number }}
SHOULD_SEED_DB: true
run-functional-tests:
needs: deploy-ephemeral
runs-on: ubuntu-latest
steps:
- name: Run functional tests
run: echo "Running functional tests against ${{ needs.deploy-ephemeral.outputs.SERVICE_URL }}"
env:
SERVICE_URL: ${{ needs.deploy-ephemeral.outputs.SERVICE_URL }}
run-perf-regression:
uses: ./.github/workflows/run-performance-test.yaml
needs: [deploy-ephemeral, run-functional-tests]
permissions:
id-token: write
contents: read
secrets:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
ARTILLERY_CLOUD_API_KEY: ${{ secrets.ARTILLERY_CLOUD_API_KEY }}
with:
ENVIRONMENT: custom
TEST_TYPE: regression
VERSION: ${{ github.sha }}
SERVICE_URL: ${{ needs.deploy-ephemeral.outputs.SERVICE_URL }}
teardown-ephemeral-env:
uses: ./.github/workflows/stack-delete.yaml
needs: run-perf-regression
permissions:
id-token: write
contents: read
secrets:
AWS_DEPLOYER_ROLE: ${{ secrets.AWS_DEPLOYER_ROLE }}
with:
ENVIRONMENT: ${{ github.actor }}-${{ github.event.pull_request.number }}