Skip to content

Commit ca84cce

Browse files
authored
cicd: add actions and templates (#5)
1 parent a35a1fa commit ca84cce

File tree

6 files changed

+285
-0
lines changed

6 files changed

+285
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Bug Report
2+
description: Report a bug.
3+
labels: ["bug"]
4+
body:
5+
- type: textarea
6+
attributes:
7+
label: Describe the bug
8+
description: Provide a clear and concise description of what the bug is.
9+
validations:
10+
required: true
11+
- type: textarea
12+
attributes:
13+
label: Steps to reproduce
14+
description: Provide detailed steps to replicate the bug.
15+
placeholder: |
16+
1. In this environment...
17+
2. With this config...
18+
3. Run '...'
19+
4. See error...
20+
validations:
21+
required: true
22+
- type: textarea
23+
attributes:
24+
label: Expected behavior
25+
description: What did you expect to happen?
26+
validations:
27+
required: true
28+
- type: textarea
29+
attributes:
30+
label: Current behavior
31+
description: |
32+
What actually happened?
33+
34+
Include full errors, stack traces, and/or relevant logs.
35+
validations:
36+
required: true
37+
- type: textarea
38+
attributes:
39+
label: Possible reason(s)
40+
description: Provide any insights into what might be causing the issue.
41+
validations:
42+
required: false
43+
- type: textarea
44+
attributes:
45+
label: Suggested fix
46+
description: Provide any suggestions on how to resolve the bug.
47+
validations:
48+
required: false
49+
- type: textarea
50+
attributes:
51+
label: Branch, commit, and/or version
52+
description: Provide the branch, commit, and/or version you're using.
53+
placeholder: |
54+
branch: issue-1
55+
commit: abc123d
56+
validations:
57+
required: true
58+
- type: textarea
59+
attributes:
60+
label: Screenshots
61+
description: If applicable, add screenshots with descriptions to help explain your problem.
62+
validations:
63+
required: false
64+
- type: textarea
65+
attributes:
66+
label: Environment details
67+
description: Provide environment details (OS name and version, etc).
68+
validations:
69+
required: true
70+
- type: textarea
71+
attributes:
72+
label: Additional details
73+
description: Provide any other additional details about the problem.
74+
validations:
75+
required: false
76+
- type: dropdown
77+
attributes:
78+
label: Contribution
79+
description: Can you contribute to the development of this feature?
80+
options:
81+
- "Yes, I can create a PR for this fix."
82+
- "Yes, but I can only provide ideas and feedback."
83+
- "No, I cannot contribute."
84+
validations:
85+
required: false
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project.
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
attributes:
7+
label: Feature description
8+
description: Provide a clear and concise description of what you want to happen.
9+
validations:
10+
required: true
11+
- type: textarea
12+
attributes:
13+
label: Use case
14+
description: |
15+
Why do you need this feature? For example: "I'm always frustrated when..."
16+
validations:
17+
required: true
18+
- type: textarea
19+
attributes:
20+
label: Proposed solution
21+
description: Provide proposed solution.
22+
validations:
23+
required: false
24+
- type: textarea
25+
attributes:
26+
label: Alternatives considered
27+
description: Describe any alternative solutions you've considered.
28+
validations:
29+
required: false
30+
- type: textarea
31+
attributes:
32+
label: Implementation details
33+
description: Provide any technical details on how the feature might be implemented.
34+
validations:
35+
required: false
36+
- type: textarea
37+
attributes:
38+
label: Potential Impact
39+
description: |
40+
Discuss any potential impacts of this feature on existing functionality or performance, if known.
41+
Will this feature cause breaking changes?
42+
What challenges might arise?
43+
validations:
44+
required: false
45+
- type: textarea
46+
attributes:
47+
label: Additional context
48+
description: Provide any other context or screenshots about the feature.
49+
validations:
50+
required: false
51+
- type: dropdown
52+
attributes:
53+
label: Contribution
54+
description: Can you contribute to the development of this feature?
55+
options:
56+
- "Yes, I can create a PR for this feature."
57+
- "Yes, but I can only provide ideas and feedback."
58+
- "No, I cannot contribute."
59+
validations:
60+
required: false

.github/workflows/checks.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: checks
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
name: test py${{ matrix.python-version }}
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
python-version: ["3.10", "3.11", "3.12"]
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
18+
- name: Install dependencies
19+
run: |
20+
python3 -m pip install ".[tests]"
21+
22+
- name: Run tests
23+
run: python3 -m pytest
24+
25+
lint:
26+
name: lint
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.11"
35+
36+
- name: Install dependencies
37+
run: python3 -m pip install ".[dev]"
38+
39+
- name: Check style
40+
run: python3 -m ruff check . && python3 -m ruff format --check .
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pull Request Has Priority Label
2+
on:
3+
pull_request:
4+
types: [opened, labeled, unlabeled, synchronize]
5+
jobs:
6+
pr-priority-label:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
outputs:
12+
status: ${{ steps.check-labels.outputs.status }}
13+
steps:
14+
- id: check-labels
15+
uses: mheap/github-action-required-labels@v5
16+
with:
17+
mode: exactly
18+
count: 1
19+
labels: "priority:*"
20+
use_regex: true
21+
add_comment: true
22+
message: "PRs require a priority label. Please add one."
23+
exit_type: failure

.github/workflows/release.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2+
name: Publish Python distribution to PyPI
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
build:
10+
name: Build distribution
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.x"
19+
- name: Install pypa/build
20+
run: >-
21+
python3 -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: python3 -m build
27+
- name: Store the distribution packages
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: python-package-distributions
31+
path: dist/
32+
publish-to-pypi:
33+
name: >-
34+
Publish Python distribution to PyPI
35+
needs:
36+
- build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/p/regbot
41+
permissions:
42+
id-token: write # IMPORTANT: mandatory for trusted publishing
43+
steps:
44+
- name: Download all the dists
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Publish distribution to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/stale.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Stalebot for issues and PRs"
2+
3+
on:
4+
schedule:
5+
- cron: "30 13 * * 1-5"
6+
7+
jobs:
8+
stale-high-priority:
9+
uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml
10+
with:
11+
days-before-issue-stale: 90
12+
days-before-pr-stale: 1
13+
labels: priority:high
14+
15+
stale-medium-priority:
16+
uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml
17+
with:
18+
days-before-issue-stale: 135
19+
days-before-pr-stale: 3
20+
labels: priority:medium
21+
22+
stale-low-priority:
23+
uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml
24+
with:
25+
days-before-issue-stale: 180
26+
days-before-pr-stale: 7
27+
labels: priority:low

0 commit comments

Comments
 (0)