reusable-workflows reusable-workflows

reusable-workflows

Botcity Reusable Workflows

To facilitate the implementation of workflows shared by all botcity projects, it is necessary to include it in this project, for example the ci, linter and publish in pypi workflows.

Available workflows

NameLanguageArgumentsSecretsDescription
python_cipythonlist_os_name, list_python_versionRun tests in pytest
python_linterpythonflake8, mypy, list_os_name, list_python_version, docstring, docstring_conventionRun flake8, mypy and flake8-docstring.
python_pypi_uploadpythonPYPI_API_TOKENBuild package and publish in pypi
docker-scandockerdocker-file, docker-image, build-command, with-maven, java-version, java-distributionRun Docker vulnerability check using Grype.

Using reusable workflows example

Workflows

Python

ci

Using values default:

name: ci
on:
push:
pull_request:
jobs:
ci:
uses: botcity-dev/botcity-reusable-workflows/.github/workflows/python_ci.yml@latest

Using passing the arguments:

NameDescriptionDefaultRequired
list_os_nameList os name to use in matrix”[‘ubuntu-latest’]“false
list_python_versionList version python to use in matrix”[‘3.9’, 3.12’]“false
name: ci
on:
push:
pull_request:
jobs:
ci:
uses: botcity-dev/botcity-reusable-workflows/.github/workflows/python_ci.yml@latest
with:
list_os_name: "['ubuntu-latest', 'windows-latest']"
list_python_version: "['3.9', '3.10', '3.12']"

Linter

Using values default:

name: linter
on:
push:
pull_request:
jobs:
linter:
uses: botcity-dev/botcity-reusable-workflows/.github/workflows/python_linter.yml@latest

Using passing the arguments:

NameDescriptionDefaultRequired
list_os_nameList os name to use in matrix”[‘ubuntu-latest’]“false
list_python_versionList version python to use in matrix”[‘3.9’]“false
mypyExecute mypy or nofalsefalse
flake8Execute flake8 or notruefalse
docstringExecute flake8-docstring or no.falsefalse
folderFolder to execute flake8 and mypy”botcity”false
docstring_conventionConvention that will be used.”google”false
name: linter
on:
push:
pull_request:
jobs:
linter:
uses: botcity-dev/botcity-reusable-workflows/.github/workflows/python_linter.yml@latest
with:
list_os_name: "['ubuntu-latest', 'windows-latest']"
list_python_version: "['3.9', '3.12']"
flake8: true
mypy: true
folder: "botcity"
docstring: true
docstring_convention: "google"

Pypi upload

Using secrets required:

NameDescriptionDefaultRequired
PYPI_API_TOKENToken to upload pipy** true **
name: Publish Python distributions to PyPI
on:
release:
types: [published]
jobs:
pypi_upload:
uses: botcity-dev/botcity-reusable-workflows/.github/workflows/python_pypi_upload.yml@latest
with:
list_version: "['3.9', '3.8']"
secrets: inherit # Or ${{ secrets.PYPI_API_TOKEN }}

← Back to projects