Skip to content

Commit 2a0e087

Browse files
committed
Added the CI/CD config
1 parent f91a660 commit 2a0e087

File tree

3 files changed

+134
-43
lines changed

3 files changed

+134
-43
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Package Release
2+
on:
3+
push:
4+
branches:
5+
- main # Later, we would like to change this to "release".
6+
pull_request:
7+
branches:
8+
- main # Later, we would like to change this to "release".
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: [ "3.13" ]
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
# language=bash
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install uv
30+
- name: Build
31+
# language=bash
32+
run: |
33+
uv build
34+
- name: Store the package
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: python-package-distributions
38+
path: dist/
39+
40+
##############################
41+
# Publish to the actual repo #
42+
##############################
43+
publish-to-pypi:
44+
name: Publish to the actual server
45+
needs:
46+
- build
47+
runs-on: ubuntu-latest
48+
49+
environment: pypi
50+
51+
permissions:
52+
id-token: write # IMPORTANT: mandatory for trusted publishing
53+
54+
steps:
55+
- name: Download all the dists
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: python-package-distributions
59+
path: dist/
60+
- name: Publish distribution 📦 to TestPyPI
61+
uses: pypa/gh-action-pypi-publish@release/v1
62+
63+
# ############################
64+
# # Publish to the test repo #
65+
# ############################
66+
# publish-to-testpypi:
67+
# name: Publish to the test server
68+
# needs:
69+
# - build
70+
# runs-on: ubuntu-latest
71+
#
72+
# environment:
73+
# name: pypi
74+
# url: https://test.pypi.org/p/deferrable-py
75+
#
76+
# permissions:
77+
# id-token: write # IMPORTANT: mandatory for trusted publishing
78+
#
79+
# steps:
80+
# - name: Download all the dists
81+
# uses: actions/download-artifact@v4
82+
# with:
83+
# name: python-package-distributions
84+
# path: dist/
85+
# - name: Publish distribution 📦 to TestPyPI
86+
# uses: pypa/gh-action-pypi-publish@release/v1
87+
# with:
88+
# repository-url: https://test.pypi.org/legacy/
89+
90+

.github/workflows/package-test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Automatic Tests
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
# language=bash
29+
run: |
30+
python -m pip install --upgrade pip
31+
python -m pip install flake8 uv
32+
- name: Lint with flake8
33+
# language=bash
34+
run: |
35+
# stop the build if there are Python syntax errors or undefined names
36+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39+
- name: Run tests
40+
# language=bash
41+
run: |
42+
# Install the package along with its dependencies.
43+
python -m pip install -I .
44+
# make test-unit

readables/deferrable.py

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

0 commit comments

Comments
 (0)