-
Notifications
You must be signed in to change notification settings - Fork 14
62 lines (58 loc) · 1.71 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
name: CI
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Lint Dockerfile with hadolint
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
ignore: DL3005
- name: Lint Helm chart
uses: WyriHaximus/[email protected]
with:
exec: helm lint ./helm/charts/scheduled-volume-snapshotter --strict
- name: Lint Python with flake8
run: |
pip install flake8
flake8 --ignore=E402,W503 --max-line-length=120 .
scan:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker Image
uses: docker/build-push-action@v2
with:
tags: localbuild/testimage:latest
push: false
load: true
no-cache: true
- name: Download Grype
uses: anchore/scan-action/download-grype@v3
id: grype
- name: Scan Docker Image for Vulnerabilities
run: |
${{steps.grype.outputs.cmd}} localbuild/testimage:latest --only-fixed --fail-on high
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest-cov==2.8.1
pytest --cov=. --cov-fail-under=90