Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Update workflows/tests #82

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 4 additions & 26 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
name: CI/CD

on: # yamllint disable-line rule:truthy
pull_request:
branches:
Expand All @@ -11,76 +9,62 @@ on: # yamllint disable-line rule:truthy
release:
types:
- published

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox

- name: Black with tox
run: tox -e black

- name: Isort with tox
run: tox -e isort

- name: Pylint with tox
run: tox -e pylint

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
dj-version: [django32, django42]
wagtail-version: [wagtail40, wagtail50]
dj-version: [django42, django50]
wagtail-version: [wagtail50, wagtail60]
steps:
- name: Install gettext
run: sudo apt-get install gettext

- uses: actions/checkout@v3

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

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox

- name: Test with tox
run: |
PY_VERSION=${{ matrix.python-version }} &&
tox -e py${PY_VERSION//.}-${{ matrix.dj-version }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand All @@ -89,7 +73,6 @@ jobs:
flags: unittests
name: ${{ matrix.python-version }}-${{ matrix.dj-version }}-${{ matrix.wagtail-version }} # yamllint disable-line rule:line-length
yml: ./codecov.yml

release:
name: Release
runs-on: ubuntu-latest
Expand All @@ -105,27 +88,22 @@ jobs:
- test
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

python-version: "3.11"
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Build Package
run: poetry build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ envlist =
black
isort
pylint
py{310,311}-django{32,42}-wagtail{40,50}
py{310,311}-django{42,50}-wagtail{50,60}

[testenv]
deps =
django32: Django==3.2
django42: Django==4.2
wagtail40: wagtail==4.0
django50: Django==5.0
wagtail50: wagtail==5.0
wagtail60: wagtail==6.0
pytest
pytest-clarity
pytest-cov
Expand Down