🏗️ Workflows (CI/CD)¶
Generate CI & CI/CD workflows¶
The exasol-toolbox simplifies and supports 3 easily maintainable workflows. in order to make them work follow the description bellow.
Workflows:
- CI
Verifies PR’s and regularly checks the project.
- CI/CD
Verifies and publishes releases of the project.
- PR-Merge
Validates merges and updates the documentation.
0. Determine the toolbox version¶
One of the snippets bellow, should do the trick:
poetry show exasol-toolbox
python -c "from exasol.toolbox.version import VERSION;print(VERSION)"
1. Configure your project¶
Make sure your github project has access to a deployment token for PyPi with the following name: PYPI_TOKEN. It should be available to the repository either as Organization-, Repository- or Environment- secret.
2. Add the standard workflows to your project¶
tbox workflow install all
Warning
If you already have various workflows you may want to run the
update
instead of the install
command.
CI Workflow¶
To enable this workflow, add a file with the name ci.yml in your .github/workflows folder and add the following content:
name: CI
on:
push:
branches-ignore:
- "github-pages/*"
- "gh-pages/*"
- "main"
- "master"
pull_request:
types: [opened, reopened]
schedule:
# “At 00:00 on every 7th day-of-month from 1 through 31.” (https://crontab.guru)
- cron: "0 0 1/7 * *"
jobs:
ci-job:
name: Checks
uses: exasol/python-toolbox/.github/workflows/checks.yml@0.6.2
metrics:
needs: [ ci-job ]
uses: exasol/python-toolbox/.github/workflows/report.yml@0.6.2
CI/CD Workflow¶
Attention
Requires PYPI token to be available
To enable this workflow, add a file with the name ci-cd.yml in your .github/workflows folder and add the following content:
name: CI/CD
on:
push:
tags:
- '**'
jobs:
check-tag-version-job:
name: Check Release Tag
uses: exasol/python-toolbox/.github/workflows/check-release-tag.yml@0.6.2
ci-job:
name: Checks
needs: [ check-tag-version-job ]
uses: exasol/python-toolbox/.github/workflows/checks.yml@0.6.2
cd-job:
name: Continues Delivery
needs: [ ci-job ]
uses: exasol/python-toolbox/.github/workflows/build-and-publish.yml@0.6.2
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
metrics:
needs: [ ci-job ]
uses: exasol/python-toolbox/.github/workflows/report.yml@0.6.2
PR-Merge Workflow¶
To enable this workflow, add a file with the name pr-merge.yml in your .github/workflows folder and add the following content:
name: PR-Merge
on:
push:
branches:
- 'main'
- 'master'
jobs:
ci-job:
name: Checks
uses: exasol/python-toolbox/.github/workflows/checks.yml@0.6.2
publish-docs:
name: Publish Documentation
uses: exasol/python-toolbox/.github/workflows/gh-pages.yml@0.6.2
metrics:
needs: [ ci-job ]
uses: exasol/python-toolbox/.github/workflows/report.yml@0.6.2