-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (61 loc) · 1.7 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
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
pull-requests:
runs-on: ubuntu-latest
steps:
- run: echo hello
api-vuln-images:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build the Container image
working-directory: ./api
run: docker build . --file Dockerfile --tag brazilian-worker/api:latest
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: brazilian-worker/api:latest
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
web-vuln-images:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build the Container image
working-directory: ./web
run: docker build . --file Dockerfile --tag brazilian-worker/web:latest
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: brazilian-worker/web:latest
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies and testing with pytest
working-directory: ./api
run: |
pip install -r requirements.txt
python -m pytest tests/