Skip to content

Commit 15ac08a

Browse files
committed
Add CI jobs
1 parent 8a8321e commit 15ac08a

File tree

6 files changed

+339
-0
lines changed

6 files changed

+339
-0
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
groups:
9+
actions:
10+
patterns:
11+
- "*"

.github/release-drafter.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name-template: "v$RESOLVED_VERSION"
2+
tag-template: "v$RESOLVED_VERSION"
3+
template: |
4+
$CHANGES
5+
6+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
7+
8+
---
9+
10+
### Release Guide
11+
12+
1. Bump version in `pyproject.toml`
13+
2. Update `CHANGELOG.md` with notes from release draft and header with version and release date
14+
3. Process links in `CHANGELOG.md` and check release date by calling `tools/process_changelog.py`
15+
4. Open a PR with the above changes and merge it
16+
5. Release the version by editing the draft
17+
18+
categories:
19+
- title: Added
20+
labels:
21+
- added
22+
- title: Changed
23+
labels:
24+
- changed
25+
- title: Deprecated
26+
labels:
27+
- deprecated
28+
- title: Removed
29+
labels:
30+
- removed
31+
- title: Fixed
32+
labels:
33+
- fixed
34+
35+
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
36+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
37+
38+
version-resolver:
39+
major:
40+
labels:
41+
- major
42+
minor:
43+
labels:
44+
- minor
45+
patch:
46+
labels:
47+
- patch
48+
default: patch
49+
50+
include-labels:
51+
- "added"
52+
- "changed"
53+
- "deprecated"
54+
- "removed"
55+
- "fixed"

.github/workflows/docs.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
11+
release:
12+
types:
13+
- published
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
name: Build
22+
runs-on: ubuntu-22.04
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Free Disk Space (Ubuntu)
28+
uses: jlumbroso/free-disk-space@main
29+
with:
30+
tool-cache: false
31+
android: true
32+
dotnet: true
33+
haskell: true
34+
large-packages: false
35+
docker-images: false
36+
swap-storage: false
37+
38+
- name: Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.12"
42+
cache: "pip"
43+
44+
- name: Set up CUDA toolkit
45+
uses: Jimver/cuda-toolkit@master
46+
with:
47+
cuda: "12.1.0"
48+
method: "network"
49+
sub-packages: '["toolkit"]'
50+
51+
- name: Install torch with CUDA support
52+
run: python -m pip install torch --index-url https://download.pytorch.org/whl/cu121
53+
54+
- name: Install torchhull
55+
run: python -m pip install --editable ".[dev]"
56+
57+
- name: Build docs
58+
run: nox -s docs
59+
60+
- uses: actions/upload-artifact@v4
61+
with:
62+
name: Docs HTML
63+
path: build/docs/html
64+
65+
publish:
66+
name: Upload release to GitHub Pages
67+
runs-on: ubuntu-22.04
68+
if: github.event_name == 'release' && github.event.action == 'published'
69+
70+
needs:
71+
- build
72+
73+
permissions:
74+
contents: write
75+
76+
steps:
77+
- uses: actions/checkout@v4
78+
79+
- uses: actions/download-artifact@v4
80+
with:
81+
name: Docs HTML
82+
path: build/docs/html
83+
84+
- uses: JamesIves/github-pages-deploy-action@v4
85+
with:
86+
folder: build/docs/html
87+
clean: true
88+
single-commit: true
89+
90+
check_docs:
91+
if: always()
92+
93+
needs:
94+
- build
95+
- publish
96+
97+
name: "Check Docs"
98+
runs-on: ubuntu-22.04
99+
100+
steps:
101+
- uses: re-actors/alls-green@release/v1
102+
with:
103+
allowed-skips: publish
104+
jobs: ${{ toJSON(needs) }}

.github/workflows/lint.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
lint:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
python: ["3.9", "3.10", "3.11", "3.12"]
21+
22+
name: "Python ${{ matrix.python }}"
23+
runs-on: ubuntu-22.04
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Python ${{ matrix.python }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python }}
32+
cache: "pip"
33+
34+
- name: Install torchhull
35+
run: python -m pip install --editable ".[dev]"
36+
37+
- name: Run linters
38+
run: nox -s lint
39+
40+
check_lint:
41+
if: always()
42+
43+
needs:
44+
- lint
45+
46+
name: "Check Lint"
47+
runs-on: ubuntu-22.04
48+
49+
steps:
50+
- uses: re-actors/alls-green@release/v1
51+
with:
52+
jobs: ${{ toJSON(needs) }}

.github/workflows/pypi.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: PyPi
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
11+
release:
12+
types:
13+
- published
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
dist:
21+
name: Distribution build
22+
runs-on: ubuntu-22.04
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: hynek/build-and-inspect-python-package@v2
28+
29+
publish-test:
30+
name: Upload release to TestPyPI
31+
runs-on: ubuntu-22.04
32+
if: github.event_name == 'release' && github.event.action == 'published'
33+
34+
needs:
35+
- dist
36+
37+
environment:
38+
name: testpypi
39+
url: https://test.pypi.org/p/torchhull
40+
41+
permissions:
42+
id-token: write
43+
44+
steps:
45+
- uses: actions/download-artifact@v4
46+
with:
47+
name: Packages
48+
path: dist
49+
50+
- uses: pypa/gh-action-pypi-publish@release/v1
51+
with:
52+
repository-url: https://test.pypi.org/legacy/
53+
54+
publish:
55+
name: Upload release to PyPI
56+
runs-on: ubuntu-22.04
57+
if: github.event_name == 'release' && github.event.action == 'published'
58+
59+
needs:
60+
- publish-test
61+
62+
environment:
63+
name: pypi
64+
url: https://pypi.org/p/torchhull
65+
66+
permissions:
67+
id-token: write
68+
69+
steps:
70+
- uses: actions/download-artifact@v4
71+
with:
72+
name: Packages
73+
path: dist
74+
75+
- uses: pypa/gh-action-pypi-publish@release/v1
76+
77+
check_pypi:
78+
if: always()
79+
80+
needs:
81+
- dist
82+
- publish-test
83+
- publish
84+
85+
name: "Check PyPI"
86+
runs-on: ubuntu-22.04
87+
88+
steps:
89+
- uses: re-actors/alls-green@release/v1
90+
with:
91+
allowed-skips: publish-test, publish
92+
jobs: ${{ toJSON(needs) }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
Update:
13+
permissions:
14+
contents: write
15+
pull-requests: read
16+
17+
runs-on: ubuntu-22.04
18+
19+
steps:
20+
- uses: release-drafter/release-drafter@v6
21+
with:
22+
config-name: release-drafter.yml
23+
disable-autolabeler: true
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)