Skip to content

Commit fe761ce

Browse files
authored
Merge pull request #23 from CoReason-AI/develop
Release version - prior to cookie cutter
2 parents 40e1db7 + 2e6634d commit fe761ce

18 files changed

Lines changed: 579 additions & 74 deletions

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git/
2+
.venv/
3+
__pycache__/
4+
.pytest_cache/
5+
.mypy_cache/
6+
docs/
7+
.github/
8+
README.md
9+
.pre-commit-config.yaml

.github/workflows/ci-cd.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
tags:
9+
- 'v*.*.*'
10+
pull_request:
11+
branches:
12+
- main
13+
- develop
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
lint:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
27+
- uses: actions/setup-python@cfd55ca82492758d853442341ad4d8010466803a
28+
with:
29+
python-version: '3.12'
30+
- name: Run pre-commit
31+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
32+
33+
test:
34+
needs: lint
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
matrix:
38+
os: [ubuntu-latest, windows-latest, macos-latest]
39+
python-version: ["3.10", "3.11", "3.12"]
40+
steps:
41+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@cfd55ca82492758d853442341ad4d8010466803a
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Cache dependencies
48+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
49+
with:
50+
path: ~/.cache/pip
51+
key: v1-${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
52+
restore-keys: |
53+
v1-${{ runner.os }}-python-${{ matrix.python-version }}-
54+
55+
- name: Install dependencies
56+
run: pip install -e ".[dev]"
57+
shell: bash
58+
59+
- name: Run tests
60+
run: pytest
61+
shell: bash
62+
63+
- name: Upload coverage to Codecov
64+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
65+
with:
66+
token: ${{ secrets.CODECOV_TOKEN }}
67+
slug: ${{ github.repository }}
68+
fail_ci_if_error: true
69+
verbose: true
70+
71+
build-docs:
72+
needs: test
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
76+
- name: Set up Python
77+
uses: actions/setup-python@cfd55ca82492758d853442341ad4d8010466803a
78+
with:
79+
python-version: '3.12'
80+
81+
- name: Cache dependencies
82+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
83+
with:
84+
path: ~/.cache/pip
85+
key: v1-${{ runner.os }}-python-3.12-${{ hashFiles('**/pyproject.toml') }}
86+
restore-keys: |
87+
v1-${{ runner.os }}-python-3.12-
88+
89+
- name: Install dependencies
90+
run: pip install -e ".[dev]"
91+
shell: bash
92+
93+
- name: Build documentation
94+
run: mkdocs build --strict
95+
shell: bash
96+
97+
release:
98+
if: startsWith(github.ref, 'refs/tags/v')
99+
needs: build-docs
100+
runs-on: ubuntu-latest
101+
permissions:
102+
id-token: write
103+
steps:
104+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
105+
- name: Set up Python
106+
uses: actions/setup-python@cfd55ca82492758d853442341ad4d8010466803a
107+
with:
108+
python-version: '3.12'
109+
110+
- name: Install dependencies
111+
run: pip install build
112+
113+
- name: Build package
114+
run: python -m build
115+
116+
- name: Publish to PyPI
117+
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
118+
with:
119+
user: __token__
120+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/docker.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build-scan-push:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
23+
24+
- name: Log in to the Container registry
25+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
36+
37+
- name: Lowercase repository name
38+
id: repo_name
39+
run: echo "name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
40+
41+
- name: Build and push
42+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
43+
with:
44+
context: .
45+
push: true
46+
tags: ghcr.io/${{ steps.repo_name.outputs.name }}:${{ github.sha }}
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max
49+
50+
- name: Scan for vulnerabilities
51+
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
52+
with:
53+
image-ref: 'ghcr.io/${{ steps.repo_name.outputs.name }}:${{ github.sha }}'
54+
format: 'table'
55+
exit-code: '1'
56+
ignore-unfixed: true
57+
vuln-type: 'os,library'
58+
severity: 'CRITICAL,HIGH'

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# .github/workflows/publish.yml
2+
name: Publish Python Package to PyPI
3+
4+
on:
5+
# Trigger the workflow only when a new release is published
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
pypi-publish:
11+
name: Upload release to PyPI
12+
runs-on: ubuntu-latest
13+
14+
# Define the environment for trusted publishing
15+
# This name 'pypi' MUST match what you configure on PyPI
16+
environment: pypi
17+
18+
# Grant OIDC token permission for the job
19+
permissions:
20+
id-token: write
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.x"
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install build
35+
36+
- name: Build package
37+
run: python -m build
38+
39+
- name: Publish package to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
# No 'user' or 'password' fields are needed here.
42+
# The action automatically uses the OIDC token from the
43+
# 'id-token: write' permission.

.gitignore

Lines changed: 12 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
3-
*.py[codz]
3+
*.py[cod]
44
*$py.class
55

66
# C extensions
@@ -20,7 +20,6 @@ parts/
2020
sdist/
2121
var/
2222
wheels/
23-
share/python-wheels/
2423
*.egg-info/
2524
.installed.cfg
2625
*.egg
@@ -46,10 +45,9 @@ htmlcov/
4645
nosetests.xml
4746
coverage.xml
4847
*.cover
49-
*.py.cover
48+
*.py,cover
5049
.hypothesis/
5150
.pytest_cache/
52-
cover/
5351

5452
# Translations
5553
*.mo
@@ -72,7 +70,6 @@ instance/
7270
docs/_build/
7371

7472
# PyBuilder
75-
.pybuilder/
7673
target/
7774

7875
# Jupyter Notebook
@@ -83,48 +80,28 @@ profile_default/
8380
ipython_config.py
8481

8582
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
83+
.python-version
8984

9085
# pipenv
9186
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
9287
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
88+
# from different sources is not a concern, Pipfile.lock also may be ignored.
9589
#Pipfile.lock
9690

97-
# UV
98-
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
#uv.lock
102-
10391
# poetry
10492
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105-
# This is especially recommended for binary packages to ensure reproducibility, and is more
106-
# commonly ignored for libraries.
107-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
93+
# This is especially true if you want to ensure deterministic builds.
94+
# However, in some cases, it may be desirable to ignore them.
10895
#poetry.lock
109-
#poetry.toml
11096

11197
# pdm
11298
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113-
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114-
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
11599
#pdm.lock
116-
#pdm.toml
117-
.pdm-python
118-
.pdm-build/
119-
120-
# pixi
121-
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122-
#pixi.lock
123-
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124-
# in the .venv directory. It is recommended not to include this directory in version control.
125-
.pixi
126-
127-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
100+
# pdm stores its cache in the specified location, which is ~/.pdm/cache by default.
101+
# It might be desirable to ignore it if you use a different cache directory.
102+
#.pdm-cache/
103+
104+
# PEP 582; used by pdm
128105
__pypackages__/
129106

130107
# Celery stuff
@@ -136,7 +113,6 @@ celerybeat.pid
136113

137114
# Environments
138115
.env
139-
.envrc
140116
.venv
141117
env/
142118
venv/
@@ -152,7 +128,7 @@ venv.bak/
152128
.ropeproject
153129

154130
# mkdocs documentation
155-
/site
131+
site/
156132

157133
# mypy
158134
.mypy_cache/
@@ -167,41 +143,3 @@ dmypy.json
167143

168144
# Cython debug symbols
169145
cython_debug/
170-
171-
# PyCharm
172-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174-
# and can be added to the global gitignore or merged into this file. For a more nuclear
175-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
176-
#.idea/
177-
178-
# Abstra
179-
# Abstra is an AI-powered process automation framework.
180-
# Ignore directories containing user credentials, local state, and settings.
181-
# Learn more at https://abstra.io/docs
182-
.abstra/
183-
184-
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186-
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188-
# you could uncomment the following to ignore the entire vscode folder
189-
# .vscode/
190-
191-
# Ruff stuff:
192-
.ruff_cache/
193-
194-
# PyPI configuration file
195-
.pypirc
196-
197-
# Cursor
198-
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199-
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200-
# refer to https://docs.cursor.com/context/ignore-files
201-
.cursorignore
202-
.cursorindexingignore
203-
204-
# Marimo
205-
marimo/_static/
206-
marimo/_lsp/
207-
__marimo__/

0 commit comments

Comments
 (0)