Skip to content

Add ci

Add ci #45

Workflow file for this run

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/