This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (130 loc) · 4.22 KB
/
ci.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
Backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/[email protected]
- name: Setup Virtualenv Cache
uses: actions/[email protected]
id: virtualenv-cache
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python 3.8
uses: actions/[email protected]
with:
python-version: 3.8
- name: Setup Poetry
uses: Gr1N/setup-poetry@v4
- name: Install Python Dependencies
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
run: make venv
- name: Lint with Flake8
run: make flake8
- name: Lint with Black
run: make black_check
- name: Checking type annotations
run: make typecheck
- name: Running tests
run: make test
- name: Set up Node 12.x
uses: actions/[email protected]
with:
node-version: '12.x'
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Set up Yarn cache
uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-
- name: Set up node_modules cache
uses: actions/[email protected]
id: node-modules-cache
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-backend
${{ runner.os }}-
- name: Install Node dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: make node_modules
- name: Set up Serverless cache
uses: actions/[email protected]
with:
path: ~/.cache/serverless-python-requirements
key: ${{ runner.os }}-serverless-python-requirements-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-serverless-python-requirements
${{ runner.os }}-
- name: Build serverless package
run: make build
Frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/[email protected]
- name: Set up Node 12.x
uses: actions/[email protected]
with:
node-version: '12.x'
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Set up Yarn cache
uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-
- name: Set up node_modules cache
uses: actions/[email protected]
id: node-modules-cache
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-frontend
${{ runner.os }}-
- name: Install Node dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: make node_modules
- name: Build frontend artifacts
run: make build
CloudFormation:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Lint CloudFormation files
uses: scottbrenner/cfn-lint-action@master
with:
args: "**/cloudformation.yml"