-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
408 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,149 @@ | ||
version: 2.1 | ||
|
||
workflows: | ||
build-deploy: | ||
jobs: | ||
- build | ||
- approval: | ||
type: approval | ||
requires: | ||
- build | ||
orbs: | ||
python: circleci/python@2.1.1 | ||
|
||
executors: | ||
app-executor: | ||
docker: | ||
- image: cimg/python:3.11 | ||
# @ 13-Sep-23: | ||
# ubuntu 22.04.2 LTS | python3 3.11.5 | poetry 1.6.1 | ||
working_directory: ~/app | ||
|
||
aliases: | ||
- &install-dependencies | ||
run: | ||
name: Install dependencies | ||
command: poetry install | ||
|
||
- &install-dev-dependencies | ||
run: | ||
name: Install dev dependencies | ||
command: poetry install --only dev | ||
|
||
- &install-test-dependencies | ||
run: | ||
name: Install test dependencies | ||
command: poetry install --only test | ||
|
||
- &build-project | ||
run: | ||
name: Build Project | ||
command: poetry install | ||
|
||
jobs: | ||
requirements: | ||
executor: app-executor | ||
steps: | ||
- checkout | ||
- python/install-packages: | ||
pkg-manager: poetry | ||
- run: | ||
name: Requirements check | ||
command: | | ||
python -V | ||
poetry -V | ||
lint: | ||
# executor: app-executor | ||
executor: &python-executor | ||
name: python/default | ||
tag: "3.11" | ||
steps: | ||
- checkout | ||
- *install-dev-dependencies | ||
- run: &git-diff-py-files | ||
name: List added, copied, modified, and renamed *py files | ||
command: git diff --name-only --diff-filter=ACMR origin/main | grep -E "(.py$)" > diff.txt || true | ||
- run: | ||
name: Ruff linting | ||
command: poetry run ruff check --config=pyproject.toml . &> lint_checks.txt || true | ||
- run: | ||
name: Diff-based ruff | ||
command: &display-lint-errors | | ||
grep -Ff diff.txt lint_checks.txt > lint_errors.txt || true | ||
if [ -s lint_errors.txt ]; then | ||
cat lint_errors.txt | ||
printf 'Run the following command to fix your branch:\n make fixes' | ||
exit 1 | ||
fi | ||
|
||
format: | ||
# executor: app-executor | ||
executor: *python-executor | ||
steps: | ||
- checkout | ||
- *install-dev-dependencies | ||
- run: *git-diff-py-files | ||
- run: | ||
name: Black style formatting | ||
command: | | ||
python -V | ||
poetry -V | ||
poetry run black . --check --diff --color --config=pyproject.toml &> lint_checks.txt || true | ||
- run: | ||
name: Diff-based black | ||
command: *display-lint-errors | ||
|
||
test: | ||
# executor: app-executor | ||
executor: *python-executor | ||
steps: | ||
- checkout | ||
- python/install-packages: | ||
pkg-manager: poetry | ||
- run: | ||
name: Unit testing | ||
command: | | ||
python -V | ||
poetry -V | ||
build: | ||
docker: | ||
- image: cimg/python:3.11.5 | ||
executor: app-executor | ||
steps: | ||
- checkout | ||
- *install-dependencies | ||
- run: | ||
name: Ruff linting and Black formatting | ||
name: Build | ||
command: | | ||
python -V | ||
poetry -V | ||
workflows: | ||
ci: | ||
jobs: | ||
- requirements: | ||
name: Validate requirements | ||
filters: &ci-filter | ||
branches: | ||
ignore: main | ||
tags: | ||
ignore: /.*/ | ||
|
||
- lint: | ||
name: Ruff linting | ||
filters: *ci-filter | ||
requires: | ||
- Validate requirements | ||
|
||
- format: | ||
name: Black formatting | ||
filters: *ci-filter | ||
requires: | ||
- Validate requirements | ||
|
||
- test: | ||
name: Unit testing | ||
filters: *ci-filter | ||
requires: | ||
- Ruff linting | ||
- Black formatting | ||
|
||
build: | ||
jobs: | ||
- build | ||
- approval: | ||
type: approval | ||
requires: | ||
- build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
name: Bump version | ||
name: bump version | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
|
||
env: | ||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
|
||
jobs: | ||
bump-version: | ||
bump_version: | ||
if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }} | ||
runs-on: ubuntu-latest | ||
name: "Bump version and create changelog with commitizen" | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
token: PERSONAL_ACCESS_TOKEN | ||
fetch-depth: 0 | ||
- name: Create bump and changelog | ||
uses: commitizen-tools/commitizen-action@master | ||
with: | ||
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
github_token: PERSONAL_ACCESS_TOKEN | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,98 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
branches-ignore: main | ||
name: ci | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
lint-ruff: | ||
requirements: | ||
# Ubunty latest @ 13-Sep-23: | ||
# Ubuntu 22.04.3 LTS | Python 3.10.12 | Pipx 1.2.0 | No poetry | PostgreSQL 14.9 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: python -m pipx install poetry | ||
- name: Set up Python version from Poetry config | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: 'pyproject.toml' | ||
cache: 'poetry' # caching poetry dependencies | ||
# Warning: poetry cache is not found | ||
- name: Requirements check | ||
run: poetry install --no-interaction | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
needs: [requirements] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# - name: Set up Python 3.11 | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: 3.11 | ||
- uses: actions/checkout@v4 | ||
- run: python -m pipx install poetry | ||
- name: Set up Python version from Poetry config | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: 'pyproject.toml' | ||
cache: 'poetry' # caching poetry dependencies | ||
# Warning: poetry cache is not found | ||
- run: poetry install --only dev --no-interaction | ||
- name: Ruff linting | ||
uses: chartboost/ruff-action@v1 | ||
with: | ||
args: check --config=pyproject.toml --verbose | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# python -m pip install poetry | ||
# poetry install | ||
check-black: | ||
args: --config=pyproject.toml | ||
|
||
format: | ||
runs-on: ubuntu-latest | ||
needs: [requirements] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.11 | ||
- uses: actions/checkout@v4 | ||
- run: python -m pipx install poetry | ||
- name: Set up Python version from Poetry config | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Black formatting | ||
python-version-file: 'pyproject.toml' | ||
cache: 'poetry' # caching poetry dependencies | ||
# Warning: poetry cache is not found | ||
- run: poetry install --only dev --no-interaction | ||
- name: Black style formatting | ||
uses: psf/black@stable | ||
with: | ||
options: --color --config=pyproject.toml --verbose | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# python -m pip install poetry | ||
# poetry install --only dev | ||
# poetry run black . | ||
options: --check --diff --color --config=pyproject.toml | ||
# env: | ||
# CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: [lint, format] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: python -m pipx install poetry | ||
- name: Set up Python version from Poetry config | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: 'pyproject.toml' | ||
cache: 'poetry' # caching poetry dependencies | ||
# Warning: poetry cache is not found | ||
- run: poetry install --only dev --no-interaction | ||
- name: Unit testing | ||
run: | | ||
python -V | ||
poetry -V | ||
# poetry run pytest | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: python -m pipx install poetry | ||
- name: Set up Python version from Poetry config | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: 'pyproject.toml' | ||
cache: 'poetry' # caching poetry dependencies | ||
# Warning: poetry cache is not found | ||
- run: poetry install | ||
- name: Build | ||
run: | | ||
python -V | ||
poetry -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.