-
Notifications
You must be signed in to change notification settings - Fork 11
74 lines (64 loc) · 2.04 KB
/
main.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
name: CI
on: [push]
jobs:
miniconda:
name: Setup and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
environment-file: environment.yml
use-mamba: true
auto-activate-base: true
- shell: bash -l {0}
run: |
conda info
conda list
- name: Install earthspy
shell: bash -l {0}
run: |
pip install -e .
- name: Checkout code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Lint code base
uses: github/super-linter/slim@v7
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_JSON: true
VALIDATE_YAML: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests and generate coverage report
shell: bash -l {0}
run: |
pip install pytest
pip install pytest-cov
pytest --cov --junitxml=junit.xml -o junit_family=legacy
env:
SH_CLIENT_ID: ${{ secrets.SH_CLIENT_ID }}
SH_CLIENT_SECRET: ${{ secrets.SH_CLIENT_SECRET }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Install dev requirements
shell: bash -l {0}
run: |
pip install -r requirements-dev.txt
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/python@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --file=requirements-dev.txt --package-manager=pip --severity-threshold=high --skip-unresolved=true