Merge pull request #188 from Geoplateforme/dev #44
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 Prod | |
on: | |
push: | |
branches: [prod] | |
tags: | |
- 'v*' | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: Checks | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip setuptools flit | |
flit install --extras test | |
- name: "Analyse code with black" | |
run: black --diff --check sdk_entrepot_gpf tests | |
- name: "Analyse code with pylint" | |
run: pylint --rcfile=.pylintrc --disable=fixme sdk_entrepot_gpf --recursive=y | |
- name: "Analyse tests with pylint" | |
run: pylint --rcfile=.pylintrc --disable=fixme tests --recursive=y | |
- name: "Analyse code with mypy" | |
run: mypy --strict sdk_entrepot_gpf tests | |
- name: "Run unit tests" | |
run: coverage run -m unittest discover -b -p *TestCase.py | |
publish: | |
name: Publish to PyPi | |
needs: [tests] | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: pip install --upgrade pip setuptools flit | |
- name: Build and publish | |
run: flit publish --pypirc .pypirc --repository pypi | |
env: | |
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }} |