Merge pull request #14 from pescheckit/fix-conf-path #58
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 | |
on: | |
push: | |
branches: | |
- main # Change this to the default branch of your repository | |
pull_request: | |
branches: | |
- main # Change this to the default branch of your repository | |
release: | |
types: [published] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'release' | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Pipenv | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv ruff | |
- name: Install dependencies with Pipenv | |
run: | | |
pipenv install --dev | |
- name: Analysing the code with pylint | |
run: | | |
pipenv run pylint django_country_kit dev project | |
- name: Check code style with flake8 | |
run: | | |
pipenv run flake8 . | |
- name: Check import order with isort | |
run: | | |
pipenv run isort --check-only --diff . | |
- name: Linting with Ruff | |
run: | | |
ruff . | |
build_django_50: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'release' | |
needs: lint | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
django-version: ["5.0"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies and setuptools | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install setuptools | |
- name: Install specific Django version | |
run: pip install Django==${{ matrix.django-version }} | |
- name: Run tests | |
run: | | |
python manage.py test | |
- name: Build distribution package | |
run: python setup.py sdist | |
- name: Archive distribution package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist/*.tar.gz | |
build_django_42: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'release' | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9"] | |
django-version: ["4.2"] | |
needs: lint | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install specific Django version | |
run: pip install Django==${{ matrix.django-version }} | |
- name: Run tests | |
run: | | |
python manage.py test | |
- name: Build distribution package | |
run: python setup.py sdist | |
- name: Archive distribution package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist/*.tar.gz | |
build_django_32: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'release' | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9"] | |
django-version: ["3.2"] | |
needs: lint | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install specific Django version | |
run: pip install Django==${{ matrix.django-version }} | |
- name: Run tests | |
run: | | |
python manage.py test | |
- name: Build distribution package | |
run: python setup.py sdist | |
- name: Archive distribution package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist/*.tar.gz | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
environment: release | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Install pypa/setuptools | |
run: >- | |
python -m | |
pip install wheel | |
- name: Extract tag name | |
id: tag | |
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3) | |
- name: Update version in setup.py | |
run: >- | |
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py | |
- name: Build a binary wheel | |
run: >- | |
python setup.py sdist bdist_wheel | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |