Skip to content

Commit

Permalink
update CI testing #148, #146
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Jan 7, 2025
1 parent e8c4558 commit dd82e34
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 59 deletions.
108 changes: 55 additions & 53 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test

on:
push:
branches: main
# branches: main
pull_request:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -52,7 +52,8 @@ jobs:
- name: Install
run: |
just init
just install Django~=${{ matrix.django-version }}
just install
just pin-dependency Django~=${{ matrix.django-version }}
- name: Install Emacs
if: ${{ github.event.inputs.debug == 'true' }}
run: |
Expand Down Expand Up @@ -102,7 +103,8 @@ jobs:
- name: Install
run: |
just init
just install Django~=${{ matrix.django-version }}
just install
just pin-dependency Django~=${{ matrix.django-version }}
- name: Install VIM
if: ${{ github.event.inputs.debug == 'true' }}
uses: rhysd/action-setup-vim@v1
Expand Down Expand Up @@ -158,7 +160,8 @@ jobs:
- name: Install
run: |
just init
just install Django~=${{ matrix.django-version }}
just install
just pin-dependency Django~=${{ matrix.django-version }}
- name: Setup tmate session
if: ${{ github.event.inputs.debug == 'true' }}
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -200,7 +203,8 @@ jobs:
- name: Install
run: |
just init
just install Django~=${{ matrix.django-version }}
just install
just pin-dependency Django~=${{ matrix.django-version }}
- name: Install Fish shell
run: |
sudo apt-get update
Expand All @@ -217,7 +221,7 @@ jobs:
timeout-minutes: 60
- name: Run Unit Tests
run: |
just test tests/shellcompletion/*
just test tests/shellcompletion/test_bash.py
mv .coverage linux-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
- name: Store coverage files
Expand All @@ -226,7 +230,7 @@ jobs:
name: coverage-linux-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}
path: linux-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage

macos-shell-completion:
macos-zsh-completion:
runs-on: macos-latest
strategy:
matrix:
Expand Down Expand Up @@ -284,7 +288,8 @@ jobs:
- name: Install
run: |
just init
just install Django~=${{ matrix.django-version }}
just install
just pin-dependency Django~=${{ matrix.django-version }}
- name: Setup tmate session
if: ${{ github.event.inputs.debug == 'true' }}
uses: mxschmitt/action-tmate@v3
Expand All @@ -295,60 +300,57 @@ jobs:
shell: zsh {0}
run: |
just test tests/shellcompletion/test_zsh.py || exit 1
mv .coverage macos-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
mv .coverage macos-zsh-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage-macos-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}
path: macos-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
name: coverage-macos-zsh-py${{ matrix.python-version }}-dj${{ matrix.django-version }}
path: macos-zsh-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage

# windows-shell-completion:
# runs-on: windows-latest
# strategy:
# matrix:
# python-version: ['3.9', '3.13']
# django-version:
# - '3.2' # LTS April 2024
# - '5.0' # April 2025
# exclude:
# - python-version: '3.9'
# django-version: '5.0'
# - python-version: '3.13'
# django-version: '3.2'
windows-powershell-completion:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.9', '3.13']
django-version:
- '3.2' # LTS April 2024
- '5.0' # April 2025
exclude:
- python-version: '3.9'
django-version: '5.0'
- 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 }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# - name: Add to Poetry to PATH
# run: echo "C:\Users\runneradmin\.local\bin" >> $env:GITHUB_PATH
# shell: powershell
# - name: Install Release Dependencies
# run: |
# pip install pipx
# pipx install poetry
# poetry config virtualenvs.in-project true
# poetry run pip install --upgrade pip
# poetry install
# poetry run pip install -U "Django~=${{ matrix.django-version }}"
# shell: powershell
# - name: Run Unit Tests
# run: |
# poetry run pytest tests/completion_tests.py::PowerShellTests
# mv .coverage windows-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
# shell: powershell
# - name: Store coverage files
# uses: actions/upload-artifact@v4
# with:
# name: coverage-windows-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}
# path: windows-complete-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
- name: Add to Poetry to PATH
run: echo "C:\Users\runneradmin\.local\bin" >> $env:GITHUB_PATH
shell: powershell
- name: Install Release Dependencies
run: |
just init
just install
just pin-dependency Django~=${{ matrix.django-version }}
shell: powershell
- name: Run Unit Tests
run: |
just test tests/shellcompletion/test_powershell.py
mv .coverage windows-powershell-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage
shell: powershell
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage-windows-powershell-py${{ matrix.python-version }}-dj${{ matrix.django-version }}
path: windows-powershell-py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage

coverage-combine:
needs: [test-linux, test-windows, linux-shell-completion, macos-shell-completion] #, windows-shell-completion]
needs: [test-linux, test-windows, test-macos, linux-bash-completion, macos-zsh-completion, windows-powershell-completion]
runs-on: ubuntu-latest

steps:
Expand Down
12 changes: 6 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@ init:
install-precommit:
poetry run pre-commit install

install *PACKAGES="Django":
install:
poetry env use python
poetry lock
poetry install -E rich
poetry run pre-commit install
poetry run pip install -U {{ PACKAGES }}

install-colorama:
poetry run pip install colorama

install-docs:
poetry env use python
poetry lock
poetry install --with docs

pin-dependency +PACKAGES:
poetry run pip install -U {{ PACKAGES }}

check-types:
poetry run mypy django_typer
poetry run pyright
Expand Down Expand Up @@ -116,7 +115,8 @@ test-rich:
poetry install -E rich
poetry run pytest -m rich --cov-append

test-all: test-rich test-no-rich install-colorama
test-all: test-rich test-no-rich
poetry run pip 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
Expand Down

0 comments on commit dd82e34

Please sign in to comment.