Skip to content

Commit

Permalink
Merge branch 'main' into alter-react-endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilPawel authored and KamilPawel committed Oct 2, 2023
2 parents 8ccc9cb + 5fb2306 commit 2f710c6
Show file tree
Hide file tree
Showing 31 changed files with 1,335 additions and 186 deletions.
72 changes: 49 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,71 +6,67 @@ on:
paths-ignore:
- "codeforlife/version.py"
- "CHANGELOG.md"
workflow_dispatch:

env:
PYTHON_VERSION: 3.8

jobs:
test:
name: Test Code
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- name: 🛫 Checkout
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Python Packages
- name: 🛠 Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv install --dev
- name: Check Code Format
- name: 🔎 Check Code Format
run: if ! pipenv run black --check .; then exit 1; fi

- name: Check Migrations
- name: 🔎 Check Migrations
run: pipenv run python manage.py makemigrations --check --dry-run

# TODO: assert code coverage target.
- name: Test Code Units
- name: 🧪 Test Code Units
run: pipenv run pytest

release:
name: Publish Release
concurrency: release
sync:
runs-on: ubuntu-latest
needs: [test]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fetch-depth: 0
- name: 🛫 Checkout
uses: actions/checkout@v3

- name: Set up Python
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Dependencies
- name: 🛠 Install Dependencies
run: |
python -m pip install --upgrade pip
# pipenv-setup requires downgraded vistir: https://github.com/Madoshakalaka/pipenv-setup/issues/138
python -m pip install python-semantic-release~=7.33 pipenv-setup[black]==3.2.0 vistir==0.6.1
python -m pip install pipenv-setup[black]==3.2.0 vistir==0.6.1
- name: Setup Git
- name: ⚙️ Configure Git
run: |
git config --local user.name github-actions
git config --local user.email github-actions@github.com
git config --local user.name cfl-bot
git config --local user.email codeforlife-bot@ocado.com
- name: Sync Setup Dependencies
- name: 🔄 Sync Setup Dependencies
run: |
pipenv-setup sync
git add setup.py
Expand All @@ -81,7 +77,37 @@ jobs:
git push
fi
- name: Publish Semantic Release
release:
concurrency: release
runs-on: ubuntu-latest
needs: [sync]
if: github.ref_name == 'main'
steps:
- name: 🛫 Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fetch-depth: 0

- name: 🔄 Sync Setup Dependencies
run: git pull

- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: 🛠 Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install python-semantic-release~=7.33
- name: ⚙️ Configure Git
run: |
git config --local user.name cfl-bot
git config --local user.email [email protected]
- name: 🚀 Publish Semantic Release
env:
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: semantic-release publish --verbosity=INFO
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"black-formatter.args": [
"--config",
"pyproject.toml"
],
"python.testing.pytestArgs": [
"tests"
"-c=pyproject.toml",
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

<!--next-version-placeholder-->

## v0.8.0 (2023-10-02)

### Feature

* Otp ([#12](https://github.com/ocadotechnology/codeforlife-package-python/issues/12)) ([`4923f02`](https://github.com/ocadotechnology/codeforlife-package-python/commit/4923f0294a176ab6228568446234397a7bc63ddf))

## v0.7.14 (2023-09-21)

### Fix
Expand Down
8 changes: 7 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ django-two-factor-auth = "==1.13.2"
django-cors-headers = "==4.1.0"
pydantic = "==1.10.7"
flask = "==2.2.3"
pyotp = "==2.9.0"
importlib-metadata = "==4.13.0" # TODO: remove. needed by old portal
django-formtools = "==2.2" # TODO: remove. needed by old portal
django-otp = "==1.0.2" # TODO: remove. needed by old portal
# https://pypi.org/user/codeforlife/
cfl-common = "==6.36.2" # TODO: remove
cfl-common = "==6.37.1" # TODO: remove
codeforlife-portal = "==6.37.1" # TODO: remove
aimmo = "==2.10.6" # TODO: remove
rapid-router = "==5.11.3" # TODO: remove
phonenumbers = "==8.12.12" # TODO: remove

[dev-packages]
black = "==23.1.0"
Expand All @@ -24,6 +29,7 @@ pytest-django = "==4.5.2"
django-extensions = "==3.2.1"
pyparsing = "==3.0.9"
pydot = "==1.4.2"
pytest-env = "==0.8.1"

[requires]
python_version = "3.8"
Loading

0 comments on commit 2f710c6

Please sign in to comment.