Skip to content

Commit 85b7785

Browse files
committed
Move to GitHub Actions
This is copied over from Django Lightweight Queue, with light modifications.
1 parent b43703c commit 85b7785

File tree

3 files changed

+95
-116
lines changed

3 files changed

+95
-116
lines changed

.circleci/config.yml

-116
This file was deleted.

.github/workflows/check.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
python-version: ["3.8", "3.9", "3.10", "3.11"]
17+
django-version: ["3.2", "4.0", "4.1", "4.2", "5.0"]
18+
exclude:
19+
# Python 3.11 is not supported until Django 4.1
20+
- python-version: "3.11"
21+
django-version: "3.2"
22+
- python-version: "3.11"
23+
django-version: "4.0"
24+
25+
# Python <3.10 is not supported by Django 5.0+
26+
- python-version: "3.8"
27+
django-version: "5.0"
28+
- python-version: "3.9"
29+
django-version: "5.0"
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Poetry
36+
run: pipx install poetry==1.3.2
37+
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
cache: poetry
43+
44+
- name: Set up dependencies
45+
run: |
46+
poetry install
47+
poetry run pip install "django~=${{ matrix.django-version }}.0"
48+
49+
- name: Run tests
50+
run: poetry run ./runtests

.github/workflows/publish.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Create Release & Publish to PYPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
run-checks:
10+
uses: ./.github/workflows/check.yml
11+
12+
publish:
13+
runs-on: ubuntu-latest
14+
needs:
15+
- run-checks
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
# work around actions/checkout stripping annotations https://github.com/actions/checkout/issues/290
20+
- name: Fetch tags
21+
run: git fetch --tags --force
22+
23+
- name: Set up Poetry
24+
run: pipx install poetry==1.3.2
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.9'
30+
cache: poetry
31+
32+
- name: Build
33+
run: poetry build
34+
35+
- name: Publish to PyPI
36+
run: |
37+
poetry publish \
38+
--username "${PYPI_USERNAME}" \
39+
--password "${PYPI_PASSWORD}" \
40+
--no-interaction
41+
42+
- name: Create GitHub Release
43+
uses: ncipollo/release-action@v1
44+
with:
45+
body: ${{ steps.tag_data.outputs.git-tag-annotation }}

0 commit comments

Comments
 (0)