Skip to content

Commit

Permalink
Move to GitHub Actions
Browse files Browse the repository at this point in the history
This is copied over from Django Lightweight Queue, with light modifications.
  • Loading branch information
PeterJCLaw committed Apr 16, 2024
1 parent b43703c commit 0bfe239
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 116 deletions.
116 changes: 0 additions & 116 deletions .circleci/config.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Check

on:
push:
branches:
- main
pull_request:

jobs:
test:
name: Test
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
django-version: ["3.2", "4.0", "4.1", "4.2", "5.0"]
exclude:
# Python 3.11 is not supported until Django 4.1
- python-version: "3.11"
django-version: "3.2"
- python-version: "3.11"
django-version: "4.0"

# Python <3.10 is not supported by Django 5.0+
- python-version: "3.8"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.0"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Poetry
run: pipx install poetry==1.3.2

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

- name: Set up dependencies
run: |
poetry install
poetry run pip install "django~=${{ matrix.django-version }}.0"
- name: Run tests
run: poetry run ./runtests
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create Release & Publish to PYPI

on:
push:
tags:
- 'v*'

jobs:
run-checks:
uses: ./.github/workflows/check.yml

publish:
runs-on: ubuntu-latest
needs:
- run-checks
steps:
- uses: actions/checkout@v4

# work around actions/checkout stripping annotations https://github.com/actions/checkout/issues/290
- name: Fetch tags
run: git fetch --tags --force

- name: Set up Poetry
run: pipx install poetry==1.3.2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: poetry

- name: Build
run: poetry build

- name: Publish to PyPI
run: |
poetry publish \
--username "${PYPI_USERNAME}" \
--password "${PYPI_PASSWORD}" \
--no-interaction
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
body: ${{ steps.tag_data.outputs.git-tag-annotation }}

0 comments on commit 0bfe239

Please sign in to comment.