Skip to content

Commit df7d17a

Browse files
Add GH templates and actions workflows (#1)
1 parent e275884 commit df7d17a

31 files changed

+1300
-28
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.bat]
14+
indent_style = tab
15+
end_of_line = crlf
16+
17+
[LICENSE]
18+
insert_final_newline = false
19+
20+
[Makefile]
21+
indent_style = tab

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Bug Report
2+
description: File a bug report to help us improve this software
3+
title: "[Bug]: "
4+
labels: ["Type: Bug"]
5+
assignees: []
6+
body:
7+
- type: textarea
8+
id: what-happened
9+
attributes:
10+
label: What happened?
11+
description: |
12+
Thanks for reporting a bug! Please describe what you were trying to get done.
13+
Tell us what happened, what went wrong.
14+
validations:
15+
required: true
16+
17+
- type: textarea
18+
id: what-did-you-expect-to-happen
19+
attributes:
20+
label: What did you expect to happen?
21+
description: |
22+
Describe what you expected to happen.
23+
validations:
24+
required: false
25+
26+
- type: textarea
27+
id: sample-code
28+
attributes:
29+
label: Minimal Complete Verifiable Example
30+
description: |
31+
Minimal, self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report:
32+
33+
- [Minimal Complete Verifiable Examples](https://stackoverflow.com/help/mcve)
34+
- [Craft Minimal Bug Reports](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
35+
36+
Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly.
37+
This will be automatically formatted into code, so no need for markdown backticks.
38+
render: python
39+
40+
- type: textarea
41+
id: log-output
42+
attributes:
43+
label: Relevant log output
44+
description: Please copy and paste any relevant output. This will be automatically formatted into code, so no need for markdown backticks.
45+
render: python
46+
47+
- type: textarea
48+
id: extra
49+
attributes:
50+
label: Anything else we need to know?
51+
description: |
52+
Please describe any other information you want to share.
53+
54+
- type: textarea
55+
id: show-versions
56+
attributes:
57+
label: Environment
58+
description: |
59+
List your software version
60+
validations:
61+
required: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Documentation Update
2+
description: Update documentation
3+
title: "[Doc]: "
4+
labels: ["Type: Documentation"]
5+
assignees: []
6+
body:
7+
- type: textarea
8+
id: description
9+
attributes:
10+
label: Describe your documentation update
11+
description: |
12+
Concise description of why the documentation is being updated (e.g., missing content for new feature, typo)
13+
If this is related to an issue or PR, please mention it.
14+
validations:
15+
required: true
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Feature Request
2+
description: Suggest an idea for this software
3+
title: "[Feature]: "
4+
labels: ["Type: Enhancement"]
5+
assignees: []
6+
body:
7+
- type: textarea
8+
id: description
9+
attributes:
10+
label: Is your feature request related to a problem?
11+
description: |
12+
Please do a quick search of existing issues to make sure that this has not been asked before.
13+
Please provide a clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
14+
validations:
15+
required: true
16+
17+
- type: textarea
18+
id: solution
19+
attributes:
20+
label: Describe the solution you'd like
21+
description: |
22+
A clear and concise description of what you want to happen.
23+
validations:
24+
required: false
25+
26+
- type: textarea
27+
id: alternatives
28+
attributes:
29+
label: Describe alternatives you've considered
30+
description: |
31+
A clear and concise description of any alternative solutions or features you've considered.
32+
validations:
33+
required: false
34+
35+
- type: textarea
36+
id: additional-context
37+
attributes:
38+
label: Additional context
39+
description: |
40+
Add any other context about the feature request here.
41+
validations:
42+
required: false

.github/pull_request_template.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Description
2+
<!--
3+
Please include a summary of the change and which issue is fixed.
4+
Please also include relevant motivation and context.
5+
List any dependencies that are required for this change.
6+
-->
7+
8+
- Closes #<ISSUE_NUMBER_HERE>
9+
10+
## Checklist
11+
12+
- [ ] My code follows the style guidelines of this project
13+
- [ ] I have performed a self-review of my own code
14+
- [ ] My changes generate no new warnings
15+
- [ ] Any dependent changes have been merged and published in downstream modules
16+
17+
If applicable:
18+
19+
- [ ] I have added tests that prove my fix is effective or that my feature works
20+
- [ ] New and existing unit tests pass with my changes (locally and CI/CD build)
21+
- [ ] I have commented my code, particularly in hard-to-understand areas
22+
- [ ] I have made corresponding changes to the documentation
23+
- [ ] I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

.github/workflows/build_workflow.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: CI/CD Build Workflow
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
pull_request:
8+
branches: [main]
9+
10+
workflow_dispatch:
11+
12+
env:
13+
CANCEL_OTHERS: true
14+
PATHS_IGNORE: '["**/README.rst", "**/docs/**", "**/ISSUE_TEMPLATE/**", "**/pull_request_template.md", "**/.vscode/**"]'
15+
16+
jobs:
17+
pre-commit-hooks:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- id: skip_check
21+
uses: fkirc/skip-duplicate-actions@master
22+
with:
23+
cancel_others: ${{ env.CANCEL_OTHERS }}
24+
paths_ignore: ${{ env.PATHS_IGNORE }}
25+
26+
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
27+
name: Checkout Code Repository
28+
uses: actions/checkout@v3
29+
30+
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
31+
name: Set up Python 3.10
32+
uses: actions/setup-python@v3
33+
with:
34+
python-version: "3.10"
35+
36+
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
37+
# Run all pre-commit hooks on all the files.
38+
# Getting only staged files can be tricky in case a new PR is opened
39+
# since the action is run on a branch in detached head state
40+
name: Install and Run Pre-commit
41+
uses: pre-commit/[email protected]
42+
43+
build:
44+
name: Build (Python ${{ matrix.python-version }})
45+
runs-on: "ubuntu-latest"
46+
defaults:
47+
run:
48+
shell: bash -l {0}
49+
strategy:
50+
matrix:
51+
python-version: ["3.9", "3.10", "3.11"]
52+
steps:
53+
- id: skip_check
54+
uses: fkirc/skip-duplicate-actions@master
55+
with:
56+
cancel_others: ${{ env.CANCEL_OTHERS }}
57+
paths_ignore: ${{ env.PATHS_IGNORE }}
58+
do_not_skip: '["push", "workflow_dispatch"]'
59+
60+
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
61+
uses: actions/checkout@v3
62+
63+
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
64+
name: Cache Conda
65+
uses: actions/cache@v3
66+
env:
67+
# Increase this value to reset cache if conda-env/ci.yml has not changed in the workflow
68+
CACHE_NUMBER: 0
69+
with:
70+
path: ~/conda_pkgs_dir
71+
key: ${{ runner.os }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}
72+
73+
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
74+
name: Set up Conda Environment
75+
uses: conda-incubator/setup-miniconda@v2
76+
with:
77+
activate-environment: "ci"
78+
miniforge-variant: Mambaforge
79+
miniforge-version: latest
80+
use-mamba: true
81+
mamba-version: "*"
82+
environment-file: conda-env/ci.yml
83+
channel-priority: strict
84+
auto-update-conda: true
85+
# IMPORTANT: This needs to be set for caching to work properly!
86+
use-only-tar-bz2: true
87+
python-version: ${{ matrix.python-version }}
88+
89+
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
90+
name: Install Package to the CI Environment
91+
# Source: https://github.com/conda/conda-build/issues/4251#issuecomment-1053460542
92+
run: |
93+
python -m pip install --no-build-isolation --no-deps -e .
94+
95+
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
96+
name: Run Tests
97+
run: |
98+
pytest

.pre-commit-config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Configuration file for `pre-commit` tool.
2+
# Source: https://pre-commit.com/#pre-commit-configyaml---top-level
3+
exclude: "docs|node_modules|migrations|.git|.tox"
4+
default_stages: [commit]
5+
fail_fast: true
6+
7+
repos:
8+
# =======================
9+
# General file formatters
10+
# =======================
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v4.4.0
13+
hooks:
14+
- id: trailing-whitespace
15+
- id: end-of-file-fixer
16+
- id: check-yaml
17+
18+
# =======================
19+
# Python code formatters
20+
# =======================
21+
- repo: https://github.com/psf/black
22+
rev: 23.1.0
23+
hooks:
24+
- id: black
25+
26+
- repo: https://github.com/timothycrosley/isort
27+
rev: 5.12.0
28+
hooks:
29+
- id: isort
30+
31+
# =======================
32+
# Python linting
33+
# =======================
34+
- repo: https://github.com/pycqa/flake8
35+
rev: 6.0.0
36+
hooks:
37+
- id: flake8
38+
args: ["--config=setup.cfg"]
39+
additional_dependencies: [flake8-isort]

AUTHORS.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Development Lead
6+
----------------
7+
8+
9+
10+
Contributors
11+
------------
12+
13+
None yet. Why not be the first?

HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=======
2+
History
3+
=======
4+
5+
0.1.0 (2023-04-13)
6+
------------------
7+
8+
*

0 commit comments

Comments
 (0)