Skip to content

Commit

Permalink
badges and ci-cd
Browse files Browse the repository at this point in the history
  • Loading branch information
KommuSoft committed Apr 13, 2024
1 parent e02d20c commit 682d6da
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://help.github.com/en/articles/displaying-a-sponsor-button-in-your-repository
custom: https://www.buymeacoffee.com/hapytex
# https://help.github.com/en/articles/displaying-a-sponsor-button-in-your-repository
custom: https://www.buymeacoffee.com/hapytex
139 changes: 139 additions & 0 deletions .github/workflows/django-enforced-choices-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: django-enforced-choices CI
on: push
jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
with:
options: "--check"

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt install python3-django
- run: pip install Django
- run: django-admin startproject testproject
- name: checkout code
uses: actions/[email protected]
with:
path: 'testproject_temp'
- run: "mv testproject_temp/* testproject/"
- run: pip install -r requirements.txt
working-directory: 'testproject'
- run: python manage.py test --settings=docs.source.settings
working-directory: 'testproject'

no-makemigrations:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt install python3-django
- run: pip install Django
- run: django-admin startproject testproject
- name: checkout code
uses: actions/[email protected]
with:
path: 'testproject_temp'
- run: "mv testproject_temp/* testproject/"
- run: pip install -r requirements.txt
working-directory: 'testproject'
- run: python manage.py makemigrations --dry-run --settings=docs.source.settings
working-directory: 'testproject'
shell: bash

no-makemessages:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
locale: [nl]
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt install gettext python3-django
- run: pip install Django
- run: django-admin startproject testproject
- name: checkout code
uses: actions/[email protected]
with:
path: 'testproject_temp'
- run: |
shopt -s dotglob
mv testproject_temp/* testproject/
- run: pip install -r requirements.txt
working-directory: 'testproject'
- run: python manage.py makemessages --locale=${{ matrix.locale }} --settings=docs.source.settings
working-directory: 'testproject'
- run: git diff --ignore-matching-lines='^"POT-Creation-Date:' --exit-code
working-directory: 'testproject'

build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: checkout code
uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: |
pip install setuptools>=38.6.0 twine>=1.11.0 wheel>=0.31.0 setuptools_scm>=6.2
python -m setuptools_scm
python setup.py sdist bdist_wheel
test-publish:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
needs: [black, build, test, no-makemigrations, no-makemessages]
steps:
- name: checkout code
uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v4
- run: |
pip install setuptools>=38.6.0 twine>=1.11.0 wheel>=0.31.0 setuptools_scm>=6.2
python -m setuptools_scm
python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

publish:
runs-on: ubuntu-latest
needs: [test-publish]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: checkout code
uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v4
- run: |
pip install setuptools>=38.6.0 twine>=1.11.0 wheel>=0.31.0 setuptools_scm>=6.2
python -m setuptools_scm
python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# django-admin-backref

[![PyPi version](https://badgen.net/pypi/v/django-admin-backref/)](https://pypi.python.org/pypi/django-admin-backref/)
[![Documentation Status](https://readthedocs.org/projects/django-admin-backref/badge/?version=latest)](http://django-admin-backref.readthedocs.io/?badge=latest)
[![PyPi license](https://badgen.net/pypi/license/django-admin-backref/)](https://pypi.python.org/pypi/django-admin-backref/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Generate admin URLs through the models.

This package automatically attaches an `.admin_links` object to all models with a registered `ModelAdmin` (for the default admin site).
Expand Down

0 comments on commit 682d6da

Please sign in to comment.