Skip to content

Commit

Permalink
add macosx tests #148
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Nov 28, 2024
1 parent 174da60 commit 345b03a
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 12 deletions.
73 changes: 63 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ jobs:
timeout-minutes: 60
- name: Run Unit Tests
run: |
poetry run pip install colorama
poetry run pytest
poetry run pip uninstall -y rich
poetry run pytest --cov-append
poetry run pip uninstall -y colorama
poetry run pytest -k test_ctor_params --cov-append
just test
mv .coverage py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
- name: Store coverage files
Expand Down Expand Up @@ -133,10 +128,6 @@ jobs:
- name: Run Unit Tests
run: |
just test
poetry run pip uninstall -y rich
poetry run pytest --cov-append
poetry run pip uninstall -y colorama
poetry run pytest -k test_ctor_params --cov-append
mv .coverage py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
- name: Store coverage files
Expand All @@ -145,6 +136,68 @@ jobs:
name: coverage-windows-py${{ matrix.python-version }}-dj${{ matrix.django-version }}
path: py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage

test-macos:
runs-on: macos-latest
defaults:
run:
shell: zsh
strategy:
matrix:
python-version: ['3.9', '3.13']
django-version:
- '3.2' # LTS April 2024
- '5.1' # December 2025
exclude:
- python-version: '3.9'
django-version: '5.1'
- python-version: '3.13'
django-version: '3.2'

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Just
uses: extractions/setup-just@v2
- name: Set up Homebrew
if: ${{ github.event.inputs.debug == 'true' }}
uses: Homebrew/actions/setup-homebrew@master
- name: Install Emacs
if: ${{ github.event.inputs.debug == 'true' }}
run: |
brew install emacs
- name: Install Poetry
run: |
pip install pipx
pipx ensurepath
pipx install poetry
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install Release Dependencies
run: |
poetry env use python
poetry run pip install --upgrade pip setuptools wheel
just install
poetry run pip install -U "Django~=${{ matrix.django-version }}"
- name: Setup tmate session
if: ${{ github.event.inputs.debug == 'true' }}
uses: mxschmitt/action-tmate@v3
with:
detached: true
timeout-minutes: 60
- name: Run Unit Tests
run: |
just test
mv .coverage py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage-macos-py${{ matrix.python-version }}-dj${{ matrix.django-version }}
path: py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage

linux-shell-completion:
runs-on: ubuntu-latest
strategy:
Expand Down
1 change: 1 addition & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Log
v3.0.0 (202X-XX-XX)
===================

* Implemented `Run full test suite on mac osx <https://github.com/django-commons/django-typer/issues/148>`_
* Implemented `Convert check.sh to justfile <https://github.com/django-commons/django-typer/issues/147>`_
* Implemented `Run full test suite on windows in CI <https://github.com/django-commons/django-typer/issues/146>`_
* Fixed `Typer-style interface throws an assertion when no callback is present on a subgroup. <https://github.com/django-commons/django-typer/issues/145>`_
Expand Down
6 changes: 4 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ install:
poetry env use python
poetry install -E rich

install-colorama:
poetry run pip install colorama

install-docs:
poetry env use python
poetry install --with docs
Expand Down Expand Up @@ -78,8 +81,7 @@ test-rich:
poetry install -E rich
poetry run pytest -m rich --cov-append

test: test-rich test-no-rich
poetry run pip install colorama
test: test-rich test-no-rich install-colorama
poetry run pytest -m "not rich and not no_rich" --cov-append
poetry run pip uninstall -y colorama
poetry run pytest -k test_ctor_params --cov-append

0 comments on commit 345b03a

Please sign in to comment.