forked from cadauxe/rastertools
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (95 loc) · 2.97 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CI/CD Workflow
on:
pull_request:
branches:
- "main"
permissions:
contents: read
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.8.13
uses: actions/setup-python@v3
with:
python-version: "3.8.13"
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8.13
auto-activate-base: false
- name: Create test env
shell: bash -l {0}
run: |
pip install pylint mccabe
- name: code quality
shell: bash -l {0}
run: |
pylint --disable=all --fail-under=10 --enable=too-many-statements src/eolab/georastertools/
pylint --disable=all --fail-under=10 --enable=too-many-nested-blocks src/eolab/georastertools/
./continuous_integration/scripts/check_mccabe_complexity.sh 25 src/eolab/georastertools
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.8.13
uses: actions/setup-python@v3
with:
python-version: "3.8.13"
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8.13
auto-activate-base: false
- name: Create test env
shell: bash -l {0}
run: |
conda create -n test_env python=3.8.13 libgdal=3.5.2 -c conda-forge -c defaults -y
conda activate test_env
PIP_NO_BINARY=rasterio pip install .
pip install pylint mccabe
- name: code quality
shell: bash -l {0}
run: |
conda activate test_env
pylint --disable=all --fail-under=10 --enable=too-many-statements src/eolab/georastertools/
pylint --disable=all --fail-under=10 --enable=too-many-nested-blocks src/eolab/georastertools/
./continuous_integration/scripts/check_mccabe_complexity.sh 25 src/eolab/georastertools
- name: test
shell: bash -l {0}
run: |
conda activate test_env
pytest --cov-fail-under=65 --compare
deploy:
needs: test
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: testpypi
url: https://test.pypi.org/p/georastertools
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.8.13
uses: actions/setup-python@v3
with:
python-version: "3.8.13"
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8.13
auto-activate-base: false
- name: Build package
shell: bash -l {0}
run: |
conda create -n deploy_env python=3.8.13 libgdal=3.5.2 build -c conda-forge -y
conda activate deploy_env
python -m build --wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
verbose: true
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository-url: https://test.pypi.org/legacy/