-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
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
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 }} |
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