-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (102 loc) · 3.64 KB
/
pr.yml
File metadata and controls
121 lines (102 loc) · 3.64 KB
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
name: PR
on:
pull_request:
branches:
- main
env:
STAC_API_URL: ""
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
CDK_DEFAULT_ACCOUNT: ${{ secrets.AWS_ACCOUNT_ID }}
CDK_DEFAULT_REGION: us-west-2
AWS_ACCESS_KEY_ID: secrets.AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: secrets.AWS_SECRET_ACCESS_KEY
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Check out repository code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Create Config.yml
uses: franzbischoff/replace_envs@v1
env:
PROJECT_NAME: 'biomass'
DATA_BUCKET: 'biomass-earthdata-dashboard'
STAGE: ${{ steps.extract_branch.outputs.branch }}
STAC_API_URL: ''
VECTOR_TILESERVER_URL: 'https://mbtileserver.dev.maap-project.org/services'
TITILER_SERVER_URL: 'https://titiler.maap-project.org'
with:
from_file: 'stack/config.yml.example'
to_file: 'stack/config.yml'
commit: 'false'
- name: Install python packages
run: |
python -m pip install -U pip
python -m pip install .["dev,test"]
python -m pip install --upgrade setuptools packaging virtualenv
- name: run pre-commit
run: pre-commit run --all-files
# - name: Run safety dependency vulnerability check
# # ignore some vulnerabilities in twisted and httplib2 that are already installed and can't be uninstalled
# run: safety check -i 39557 -i 37040 -i 37209 -i 37554 -i 38085 -i 38368 -i 38303 -i 39608
- name: Run bandit static analysis check
run: bandit -r dashboard_api
# - name: Run test
# run: python -m pytest tests/
synth:
needs: [tests]
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Check out repository code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache Node.js modules
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('package.json') }} # or package-lock.json
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Create Config.yml
uses: franzbischoff/replace_envs@v1
env:
PROJECT_NAME: 'biomass'
DATA_BUCKET: 'biomass-earthdata-dashboard'
STAGE: ${{ steps.extract_branch.outputs.branch }}
STAC_API_URL: ''
VECTOR_TILESERVER_URL: 'https://mbtileserver.dev.maap-project.org/services'
TITILER_SERVER_URL: 'https://titiler.maap-project.org'
with:
from_file: 'stack/config.yml.example'
to_file: 'stack/config.yml'
commit: 'false'
- name: Install Node.js dependencies
run: npm install
- name: Install python packages
run: |
python -m pip install --upgrade pip
python -m pip install .["deploy"]
- name: Run CDK synth
run: npm run cdk-synth