-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (70 loc) · 1.98 KB
/
test-appsync-utils.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
name: Test AppSync utils
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
TEST_IMAGE_NAME: public.ecr.aws/lambda/nodejs:16
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm test
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Pull test docker image
run: docker pull $TEST_IMAGE_NAME
- name: Install dependencies
run: npm ci
- name: Integration test with LocalStack invoke method
run: bash ./test_in_docker.sh
localstack-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start LocalStack
uses: LocalStack/[email protected]
with:
image-tag: "latest"
use-pro: "true"
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
APPSYNC_JS_LIBS_VERSION: ${{ github.sha }}
DEBUG: "1"
DISABLE_EVENTS: "1"
- name: Ensure pro image is used
run: curl -s http://localhost:4566/_localstack/health | grep appsync
- uses: actions/setup-node@v4
- name: Execute test script
run: bash .github/execute-localstack-test.sh
- name: Get the LocalStack logs
if: success() || failure()
run: |
localstack logs | gzip > logs.txt.gz
- name: Upload the logs as an artifact
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ls-logs-${{ github.run_number }}
path: |
logs.txt.gz
retention-days: 7
- name: Print the LocalStack logs
if: success() || failure()
run: |
gunzip -c logs.txt.gz