Skip to content

Commit 8bdf28e

Browse files
authored
Add GitHub Actions workflows for linting, testing, and publishing packages (#21)
1 parent 0441024 commit 8bdf28e

3 files changed

Lines changed: 64 additions & 49 deletions

File tree

.github/workflows/main.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
id-token: write # Required for OIDC
9+
contents: read
10+
11+
jobs:
12+
publish:
13+
name: Upload release to PyPI
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-python@v6
18+
with:
19+
python-version: '3.11'
20+
cache: 'pip' # caching pip dependencies
21+
22+
- name: Install dependencies
23+
run: make deps
24+
- name: Build package
25+
run: make build
26+
- name: Publish package to PyPI
27+
uses: pypa/gh-action-pypi-publish@release/v1
28+
with:
29+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lint and test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
- name: Install dependencies
15+
run: make deps
16+
- name: Lint code
17+
run: make lint
18+
test:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
python-version: ['3.8', '3.9', '3.10', '3.11']
23+
steps:
24+
- uses: actions/checkout@v6
25+
- name: Set up Python
26+
uses: actions/setup-python@v6
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
cache: 'pip' # caching pip dependencies
30+
- name: Install dependencies
31+
run: make deps
32+
- name: Run tests
33+
run: |
34+
make install
35+
make test

0 commit comments

Comments
 (0)