-
Notifications
You must be signed in to change notification settings - Fork 24
60 lines (57 loc) · 2.05 KB
/
python-package-conda.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
name: Build and Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install conda dependencies
run: |
conda env update --file environment.yml --name base
pip install -r requirements/requirements-dev.txt
- name: Lint with black
run: |
black --verbose --check .
- name: Install requirements
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov pytest-benchmark pytest-memray
pip install -r requirements.txt
python setup.py develop
- name: Run tests and collect benchmark
run: |
pytest --verbose -p no:warnings --memray --benchmark-json output.json ./tests/test_perf.py
- name: Continuous Benchmark
uses: benchmark-action/github-action-benchmark@v1.14.0
with:
name: cnmaps Benchmark
tool: "pytest"
output-file-path: output.json
github-token: ${{ secrets.CI_TOKEN }}
gh-repository: "github.com/cnmetlab/cnmaps"
auto-push: true
alert-threshold: "150%"
comment-on-alert: true
fail-on-alert: false
benchmark-data-dir-path: "performance/"
alert-comment-cc-users: "@clarmy"
- name: Run tests and collect coverage
run: |
pytest --verbose -p no:warnings --cov ./tests/test_drawing.py ./tests/test_geo.py ./tests/test_map.py ./tests/test_issues.py
- name: Upload coverage reports to Codecov
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }}