Skip to content

Commit

Permalink
feat: added ISSUE_TEMPLATE and ci cd workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
PeriniM committed Oct 7, 2024
1 parent 56bf5f6 commit 5969ec5
Show file tree
Hide file tree
Showing 5 changed files with 373 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: 🐛 Bug report
description: Submit a bug report to help us improve BrickLLM.
labels: ["type:bug", "status:needs-triage"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report this problem!
We really appreciate the community's efforts to improve BrickLLM.
- type: checkboxes
attributes:
label: Checklist
description: Please confirm and check all the following options.
options:
- label: I have searched the [existing issues](https://github.com/EURAC-EEBgroup/brick-llm/issues) for similar issues.
required: true
- label: I added a very descriptive title to this issue.
required: true
- label: I have provided sufficient information below to help reproduce this issue.
required: true
- type: textarea
attributes:
label: Summary
description: Type here a clear and concise description of the problem. Aim for 2-3 sentences.
validations:
required: true
- type: textarea
attributes:
label: Reproducible Code Example
render: Python
description: |
If applicable, please provide a [self-contained minimal code example](https://stackoverflow.com/help/minimal-reproducible-example) that reproduces the problem you ran into.
If we can copy it, run it, and see it right away, there's a much higher chance we will be able to help you.
placeholder: |
import brickllm
# Your code here
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Please provide the steps we should take to reproduce the bug.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: Explain what you expect to happen when you go through the steps above, assuming there were no bugs.
validations:
required: false
- type: textarea
attributes:
label: Current Behavior
placeholder: |
Error message:
```
Traceback (most recent call last):
File "example.py", line 1, in <module>
import brickllm
```
description: |
Explain the buggy behavior you experience when you go through the steps above.
If you have error messages or stack traces please provide them here as well.
If applicable, add screenshots to help explain your problem.
_Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in._
validations:
required: false
- type: checkboxes
attributes:
label: Is this a regression?
description: Did this use to work the way you expected in the past?
options:
- label: Yes, this used to work in a previous version.
required: false
- type: textarea
attributes:
label: Debug info
description: |
Please share some system information related to the environment your app is running in.
Example:
- **BrickLLM version**: 0.1.0 _(get it with `$ pip show brickllm`)_
- **Python version**: 3.9 _(get it with `$ python --version`)_
- **Operating System**: MacOs 12.6
- **Browser**: Chrome
value: |
- BrickLLM version:
- Python version:
- Operating System:
- Browser:
validations:
required: false
- type: textarea
attributes:
label: Additional Information
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
_Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in._
validations:
required: false
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: ✨ Feature request
description: Suggest a feature or enhancement for BrickLLM.
labels: ["type:enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest a feature or enhancement for BrickLLM!
We really appreciate the community's efforts to improve BrickLLM ❤️
- type: checkboxes
attributes:
label: Checklist
description: Please confirm and check all the following options.
options:
- label: I have searched the [existing issues](https://github.com/EURAC-EEBgroup/brick-llm/issues) for similar feature requests.
required: true
- label: I added a descriptive title and summary to this issue.
required: true
- type: textarea
attributes:
label: Summary
description: Type here a clear and concise description of the feature or enhancement request. Aim for 2-3 sentences.
validations:
required: true
- type: textarea
attributes:
label: Why?
description: Please outline the problem, motivation, or use case related to this feature request.
placeholder: |
I'm always frustrated when ...
validations:
required: false
- type: textarea
attributes:
label: How?
description: |
Please describe the solution or implementation you'd like to see. This might include suggestions for new parameters, UI mockups etc.
Don't worry if you don't have a clear solution in mind; any input helps!
placeholder: |
Introduce a new command called `brickllm new_feature` that ...
validations:
required: false
- type: textarea
attributes:
label: Additional Context
description: |
Links? References? Anything that will give us more context about the feature request here!
_Tip: You can attach images by clicking this area to highlight it and then dragging files in._
validations:
required: false
158 changes: 158 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Release

on:
push:
branches:
- main
- pre/*

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Poetry
run: pip install poetry

- name: Install dependencies
run: poetry install --no-interaction --no-ansi

- name: Build the package
run: poetry build

- name: Cache build artifacts
uses: actions/cache@v3
with:
path: dist/
key: ${{ runner.os }}-build-${{ hashFiles('dist/**') }}
restore-keys: |
${{ runner.os }}-build-
test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Poetry
run: pip install poetry

- name: Install dependencies
run: poetry install --no-interaction --no-ansi

- name: Run Linting and Formatting Checks
run: |
poetry run ruff check brickllm tests
poetry run black --check brickllm tests
poetry run isort --check-only brickllm tests
- name: Run Type Checking
run: poetry run mypy brickllm tests

- name: Run Tests with Coverage
run: poetry run pytest --cov=brickllm --cov-report=xml tests/

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

release:
name: Release
runs-on: ubuntu-latest
needs: [build, test]
if: |
github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/pre/')) ||
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged &&
(github.event.pull_request.base.ref == 'main' || startsWith(github.event.pull_request.base.ref, 'pre/'))
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Poetry
run: pip install poetry

- name: Install dependencies
run: poetry install --no-interaction --no-ansi

- name: Semantic Release
uses: cycjimmy/[email protected]
with:
semantic_version: 23
extra_plugins: |
semantic-release-pypi@3
@semantic-release/git
@semantic-release/commit-analyzer@12
@semantic-release/release-notes-generator@13
@semantic-release/github@10
@semantic-release/changelog@6
conventional-changelog-conventionalcommits@7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
55 changes: 55 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
plugins:
- - "@semantic-release/commit-analyzer"
- preset: conventionalcommits
- - "@semantic-release/release-notes-generator"
- writerOpts:
commitsSort:
- subject
- scope
preset: conventionalcommits
presetConfig:
types:
- type: feat
section: Features
- type: fix
section: Bug Fixes
- type: chore
section: chore
- type: docs
section: Docs
- type: style
hidden: true
- type: refactor
section: Refactor
- type: perf
section: Perf
- type: test
section: Test
- type: build
section: Build
- type: ci
section: CI
- "@semantic-release/changelog"
- "semantic-release-pypi"
- "@semantic-release/github"
- - "@semantic-release/git"
- assets:
- CHANGELOG.md
- pyproject.toml
message: |-
ci(release): ${nextRelease.version} [skip ci]
${nextRelease.notes}
branches:
#child branches coming from tagged version for bugfix (1.1.x) or new features (1.x)
#maintenance branch
- name: "+([0-9])?(.{+([0-9]),x}).x"
channel: "stable"
#release a production version when merging towards main
- name: "main"
channel: "stable"
#prerelease branch
- name: "pre/beta"
channel: "dev"
prerelease: "beta"
debug: true
Empty file added CHANGELOG.md
Empty file.

0 comments on commit 5969ec5

Please sign in to comment.