🏗️ 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¶
tbx 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: ./.github/workflows/checks.yml
metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml
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: ./.github/workflows/check-release-tag.yml
ci-job:
name: Checks
needs: [ check-tag-version-job ]
uses: ./.github/workflows/checks.yml
cd-job:
name: Continuous Delivery
needs: [ ci-job ]
uses: ./.github/workflows/build-and-publish.yml
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml
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: ./.github/workflows/checks.yml
publish-docs:
name: Publish Documentation
uses: ./.github/workflows/gh-pages.yml
metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml