Skip to content

Commit f40a767

Browse files
author
Doug Borg
committed
feat: complete CI/CD infrastructure setup for StockTrim OpenAPI client
- Add GitHub Actions workflows (CI, release, security, docs) - Add Sphinx documentation infrastructure with AutoAPI - Add pre-commit hooks and quality tools (ruff, mypy, yamllint) - Add enhanced poe tasks for development workflow - Add GitHub issue/PR templates and Code of Conduct - Fix environment variable handling for proper test isolation - Match Katana project architecture and patterns - All tests passing with 100% CI pipeline success
1 parent b9b582c commit f40a767

134 files changed

Lines changed: 22358 additions & 231 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Bug Report
2+
description: File a bug report
3+
title: "[Bug]: "
4+
labels: [bug, triage]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
10+
11+
- type: input
12+
id: version
13+
attributes:
14+
label: Version
15+
description: What version of the stocktrim-openapi-client are you running?
16+
placeholder: ex. 1.0.0
17+
validations:
18+
required: true
19+
20+
- type: input
21+
id: python-version
22+
attributes:
23+
label: Python Version
24+
description: What version of Python are you using?
25+
placeholder: ex. 3.11.0
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: what-happened
31+
attributes:
32+
label: What happened?
33+
description: Also tell us, what did you expect to happen?
34+
placeholder: Tell us what you see!
35+
validations:
36+
required: true
37+
38+
- type: textarea
39+
id: reproduction
40+
attributes:
41+
label: Steps to Reproduce
42+
description: How can we reproduce this issue?
43+
placeholder: |
44+
1. Create StockTrimClient with...
45+
2. Call API method...
46+
3. See error...
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
id: logs
52+
attributes:
53+
label: Relevant log output
54+
description: Please copy and paste any relevant log output (with sensitive data removed).
55+
render: shell
56+
57+
- type: checkboxes
58+
id: terms
59+
attributes:
60+
label: Code of Conduct
61+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/dougborg/stocktrim-openapi-client/blob/main/CODE_OF_CONDUCT.md)
62+
options:
63+
- label: I agree to follow this project's Code of Conduct
64+
required: true
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project
3+
title: "[Feature]: "
4+
labels: [enhancement, triage]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to suggest a new feature!
10+
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Is your feature request related to a problem?
15+
description: A clear and concise description of what the problem is.
16+
placeholder: I'm always frustrated when...
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: solution
22+
attributes:
23+
label: Describe the solution you'd like
24+
description: A clear and concise description of what you want to happen.
25+
placeholder: I would like...
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: alternatives
31+
attributes:
32+
label: Describe alternatives you've considered
33+
description: A clear and concise description of any alternative solutions or features you've considered.
34+
placeholder: I considered...
35+
36+
- type: textarea
37+
id: additional-context
38+
attributes:
39+
label: Additional context
40+
description: Add any other context or screenshots about the feature request here.
41+
42+
- type: checkboxes
43+
id: terms
44+
attributes:
45+
label: Code of Conduct
46+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/dougborg/stocktrim-openapi-client/blob/main/CODE_OF_CONDUCT.md)
47+
options:
48+
- label: I agree to follow this project's Code of Conduct
49+
required: true

.github/pull_request_template.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Pull Request
2+
3+
## Description
4+
5+
Brief description of the changes in this PR.
6+
7+
## Type of Change
8+
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not
12+
work as expected)
13+
- [ ] Documentation update
14+
- [ ] Code refactoring
15+
- [ ] Performance improvement
16+
- [ ] Test improvements
17+
18+
## Testing
19+
20+
- [ ] I have added tests that prove my fix is effective or that my feature works
21+
- [ ] New and existing unit tests pass locally with my changes
22+
- [ ] I have tested this manually (if applicable)
23+
24+
## Code Quality
25+
26+
- [ ] My code follows the style guidelines of this project
27+
- [ ] I have performed a self-review of my own code
28+
- [ ] I have made corresponding changes to the documentation
29+
- [ ] My changes generate no new warnings
30+
- [ ] I have run `poetry run lint` and resolved any issues
31+
- [ ] I have run `poetry run format-check` and code is properly formatted
32+
33+
## Related Issues
34+
35+
Fixes #(issue number)
36+
37+
## Additional Notes
38+
39+
Any additional information, concerns, or decisions that were made during the development
40+
of this feature.

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ jobs:
8989

9090
- name: Check if client is up to date
9191
run: poetry run poe check-generated-ast
92+
93+
- name: Build documentation
94+
run: poetry run poe docs-build

.github/workflows/docs.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
release:
7+
types: [published]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.13"
32+
33+
- name: Install Poetry
34+
uses: snok/install-poetry@v1
35+
with:
36+
version: latest
37+
virtualenvs-create: true
38+
virtualenvs-in-project: true
39+
installer-parallel: true
40+
41+
- name: Load cached venv
42+
id: cached-poetry-dependencies
43+
uses: actions/cache@v4
44+
with:
45+
path: .venv
46+
key: venv-${{ runner.os }}-3.13-${{ hashFiles('**/poetry.lock') }}
47+
48+
- name: Install dependencies
49+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
50+
run: poetry install --extras dev --no-interaction
51+
52+
- name: Build documentation
53+
run: |
54+
poetry run poe docs-clean
55+
poetry run poe docs-build
56+
57+
- name: Setup Pages
58+
uses: actions/configure-pages@v5
59+
60+
- name: Upload artifact
61+
uses: actions/upload-pages-artifact@v3
62+
with:
63+
path: docs/_build/html
64+
65+
deploy:
66+
environment:
67+
name: github-pages
68+
url: ${{ steps.deployment.outputs.page_url }}
69+
runs-on: ubuntu-latest
70+
needs: build
71+
steps:
72+
- name: Deploy to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions: {}
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Python 3.13
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.13"
26+
27+
- name: Install Poetry
28+
uses: snok/install-poetry@v1
29+
with:
30+
version: latest
31+
virtualenvs-create: true
32+
virtualenvs-in-project: true
33+
installer-parallel: true
34+
35+
- name: Install dependencies
36+
run: poetry install --extras dev --no-interaction
37+
38+
- name: Run full CI pipeline
39+
run: poetry run poe ci
40+
41+
release:
42+
needs: test
43+
runs-on: ubuntu-latest
44+
concurrency: release
45+
permissions:
46+
id-token: write
47+
contents: write
48+
outputs:
49+
released: ${{ steps.release.outputs.released }}
50+
version: ${{ steps.release.outputs.version }}
51+
tag: ${{ steps.release.outputs.tag }}
52+
steps:
53+
- uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
57+
- name: Set up Python 3.13
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version: "3.13"
61+
62+
- name: Install Poetry
63+
uses: snok/install-poetry@v1
64+
with:
65+
version: latest
66+
virtualenvs-create: true
67+
virtualenvs-in-project: true
68+
installer-parallel: true
69+
70+
- name: Install dependencies
71+
run: poetry install --extras dev --no-interaction
72+
73+
- name: Python Semantic Release
74+
id: release
75+
uses: python-semantic-release/python-semantic-release@v9.0.0
76+
with:
77+
github_token: ${{ secrets.GITHUB_TOKEN }}
78+
root_options: -vv
79+
80+
- name: Build package
81+
if: steps.release.outputs.released == 'true'
82+
run: poetry build
83+
84+
- name: Upload build artifacts
85+
if: steps.release.outputs.released == 'true'
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: dist
89+
path: dist/
90+
91+
publish-pypi:
92+
name: Publish to PyPI
93+
needs: release
94+
if: needs.release.outputs.released == 'true'
95+
runs-on: ubuntu-latest
96+
environment:
97+
name: PyPI Release
98+
url: https://pypi.org/p/stocktrim-openapi-client
99+
permissions:
100+
id-token: write
101+
steps:
102+
- name: Download build artifacts
103+
uses: actions/download-artifact@v4
104+
with:
105+
name: dist
106+
path: dist/
107+
108+
- name: Publish to PyPI
109+
uses: pypa/gh-action-pypi-publish@release/v1
110+
with:
111+
attestations: true

0 commit comments

Comments
 (0)