Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

Commit 735d918

Browse files
committed
Add GitHub Actions for CI tests and PyPI publishing
1 parent f46f0ab commit 735d918

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.11", "3.12", "3.13"]
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install -e .[dev]
28+
29+
- name: Run tests
30+
run: python -m pytest -q

.github/workflows/publish-pypi.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish To PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.11"
24+
25+
- name: Build package
26+
run: |
27+
python -m pip install --upgrade pip build
28+
python -m build
29+
30+
- name: Upload artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: dist-artifacts
34+
path: dist/*
35+
36+
publish:
37+
runs-on: ubuntu-latest
38+
needs: build
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/classcharts-api
42+
43+
steps:
44+
- name: Download artifacts
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: dist-artifacts
48+
path: dist
49+
50+
- name: Publish package distributions to PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)