-
Notifications
You must be signed in to change notification settings - Fork 7
88 lines (75 loc) · 2.24 KB
/
pr-api.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
name: Validate API Pull Request
on:
pull_request:
branches:
- main
paths:
- "packages/api**/**"
- "packages/model/**"
- "packages/authorizer/**"
- "packages/cognito/**"
- "packages/helper/**"
- "!**/**.md"
- "!docs/**"
- "!packages/cms/**"
- "!infra/**"
- "!scripts/**"
- "!config/**"
workflow_dispatch:
jobs:
build:
name: Build and Validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/.npm
**/node_modules
~/.cache/Cypress
**/.serverless
**/.webpack
key: ${{ runner.os }}-build-app-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-app-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-build-app-${{ env.cache-name }}-
${{ runner.os }}-build-app-
${{ runner.os }}-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: yarn
- name: Cache DynamoDB docker images
uses: satackey/[email protected]
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
- name: Setup DynamoDB Local
uses: rrainn/[email protected]
with:
port: 8062
cors: "*"
- name: Create DynamoDB Table
working-directory: infra
run: yarn workspace infra ddb:init
- name: Smoke Test
run: yarn build:api
- name: Test API
run: yarn test:api
- name: Coverage Report
run: yarn coverage:api
- uses: actions/upload-artifact@v1
with:
name: Coverage Report
path: coverage