Merge pull request #27 from ryaneorth/optionally-ignore-failed-snapshots #106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |