-
-
Notifications
You must be signed in to change notification settings - Fork 11
95 lines (81 loc) · 2.34 KB
/
aws-e2e.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
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
---
name: Test nitric run
on:
push:
branches:
- main
- develop
pull_request:
types: [labeled]
concurrency:
group: ci-aws-e2e-tests-${{ github.ref_name }}
cancel-in-progress: true
env:
GOPROXY: https://proxy.golang.org
AWS_REGION: us-east-1
FATHOM_SITE: ${{ vars.FATHOM_SITE }}
jobs:
e2e-aws:
if: ${{ github.event.label.name == 'e2e-aws' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: cli
- name: checkout the test app
uses: actions/checkout@v3
with:
repository: nitrictech/test-app
path: test-app
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Build Nitric
run: |
cd ${{ github.workspace }}/cli
make build
mv bin/nitric $(go env GOPATH)/bin/nitric
- name: install-aws-cli
uses: unfor19/[email protected]
with:
arch: amd64
- name: Nitric UP
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd ${{ github.workspace }}/test-app
nitric up -s aws --ci
- name: Set api endpoint
id: vars
run: echo "::set-output name=apiendpoint::$(cat ~/.pulumi/stacks/testr-aws.json|jq '.checkpoint.latest.resources[] | select(.type==\"aws:apigatewayv2/api:Api\").outputs.apiEndpoint')"
- name: Run Tests
env:
BASE_URL: ${{ steps.vars.outputs.apiendpoint }}
run: |
cd ${{ github.workspace }}/test-app
make test
cleanup-aws:
runs-on: ubuntu-latest
needs: e2e-aws
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Build Nitric
run: |
if ! [ -f $(go env GOPATH)/bin/nitric ]; then
cd ${{ github.workspace }}/cli
make build
mv bin/nitric $(go env GOPATH)/bin/nitric
fi
- name: Nitric Down
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd ${{ github.workspace }}/test-app
nitric down -s aws --ci -y