Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 86 additions & 17 deletions .github/workflows/github_action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Deploy MkDocs
name: CI/CD Pipeline

on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:

permissions:
Expand All @@ -11,7 +14,8 @@ permissions:
id-token: write

jobs:
build:
build-and-deploy-docs:
if: github.ref == 'refs/heads/main'
environment: github-pages
runs-on: ubuntu-latest
steps:
Expand All @@ -24,30 +28,95 @@ jobs:
with:
python-version: '3.11'

- name: Install dependencies
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install mkdocs-material
pip install mkdocstrings[python]
pip install mkdocs-include-markdown-plugin
pip install mkdocs-mermaid2-plugin
pip install -e .
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true

- name: Install dependencies
run: poetry install

- name: Test documentation generation
run: poetry run pytest tests/test_doc_generation.py -v

- name: Build site
run: mkdocs build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run mkdocs build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

release:
if: startsWith(github.ref, 'refs/tags/v')
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
shell: bash

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version-file: './package.json,./pyproject.toml'
git-message: 'chore(release): {version}'
preset: 'angular'
tag-prefix: 'v'
output-file: 'CHANGELOG.md'
release-count: 0
skip-version-file: true
skip-commit: true

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

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true

- name: Install dependencies
run: poetry install

- name: Build wheels and source tarball
run: poetry build

- name: Create GitHub release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: ${{ steps.changelog.outputs.clean_changelog }}
files: |
dist/*.whl
dist/*.tar.gz
CHANGELOG.md
draft: false
prerelease: false

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
85 changes: 0 additions & 85 deletions .github/workflows/release.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

Expand Down
139 changes: 139 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Contributing

Thanks for your interest in contributing to auto_dev! Please take a moment to review this document **before submitting a pull request.**

If you want to contribute but aren't sure where to start, you can create a [new discussion](https://github.com/8ball030/auto_dev/discussions) or open an issue.

## Get started

This guide is intended to help you get started with contributing. By following these steps, you will understand the development process and workflow.

- [Fork the repository](#fork-the-repository)
- [Install Python and Poetry](#install-python-and-poetry)
- [Install dependencies](#install-dependencies)
- [Build the project](#build-the-project)
- [Write documentation](#write-documentation)
- [Submit a pull request](#submit-a-pull-request)
- [That's it!](#thats-it)

<br>

---

<br>

## Fork the repository

To start contributing to the project, [create a fork](https://github.com/8ball030/auto_dev/fork) and clone it to your machine using `git clone`.

Or, use the [GitHub CLI](https://cli.github.com) to create a fork and clone it in one command:

```bash
gh repo fork 8ball030/auto_dev --clone
```

<div align="right">
<a href="#get-started">&uarr; back to top</a></b>
</div>

## Install Python and Poetry

auto_dev uses [Poetry](https://python-poetry.org/) for dependency management. You need to install **Python 3.9 or higher** and **Poetry < 2.0**.

You can run the following commands in your terminal to check your local Python and Poetry versions:

```bash
python --version
poetry --version
```

If the versions are not correct or you don't have Python or Poetry installed:

- Install Python from the [official website](https://python.org) or using [pyenv](https://github.com/pyenv/pyenv)
- Install [Poetry](https://python-poetry.org/docs/#installation)

<div align="right">
<a href="#get-started">&uarr; back to top</a></b>
</div>

## Install dependencies

In the root directory, run the following command to install the project's dependencies:

```bash
poetry install
```

<div align="right">
<a href="#get-started">&uarr; back to top</a></b>
</div>

## Build the project

In the root directory, run the build command:

```bash
pip install -e .
```

<div align="right">
<a href="#get-started">&uarr; back to top</a></b>
</div>


When adding new features or fixing bugs, it's important to add test cases in /tests to cover any new or updated behavior.

### Code Quality Checks

Before pushing your changes, make sure to run the following quality checks:

```bash
# Format code
make fmt

# Run linting checks
make lint

# Run tests
make test
```

These commands will ensure your code:
- Follows the project's formatting standards
- Passes all linting rules
- Successfully runs all tests

Running these checks locally before pushing will help catch issues early and speed up the review process.

<div align="right">
<a href="#get-started">&uarr; back to top</a></b>
</div>

## Write documentation

auto_dev uses [MkDocs](https://www.mkdocs.org/) with Material theme for the documentation website. To start the docs website in dev mode, run:

```bash
poetry run mkdocs serve
```

<div align="right">
<a href="#get-started">&uarr; back to top</a></b>
</div>

## Submit a pull request

When you're ready to submit a pull request, follow these naming conventions:

- Pull request titles use the [imperative mood](https://en.wikipedia.org/wiki/Imperative_mood) (e.g., `Add something`, `Fix something`).
- Commit messages should be clear and descriptive.

When you submit a pull request, GitHub Actions will automatically lint, build, and test your changes. If you see an ❌, it's most likely a problem with your code. Inspect the logs through the GitHub Actions UI to find the cause.

<div align="right">
<a href="#get-started">&uarr; back to top</a></b>
</div>

## That's it!

If you still have questions, please create a [new issue](https://github.com/8ball030/auto_dev/issues).
Loading
Loading