🏗️ 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:

  1. poetry show exasol-toolbox
    
  2. 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

Warning

When you use the configurations bellow you should replace @main ref with a ref which is pointing to the toolbox version you are using. E.g. if you are using toolbox version 0.1.0 replace all references to @main with references to @0.1.0.

CI Workflow

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.4.0

  metrics:
    needs: [ ci-job ]
    uses: exasol/python-toolbox/.github/workflows/report.yml@0.4.0

CI/CD Workflow

Attention

Requires PYPI token to be available

ci-cd-workflow

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.4.0

  ci-job:
    name: Checks
    needs: [ check-tag-version-job ]
    uses: exasol/python-toolbox/.github/workflows/checks.yml@0.4.0

  cd-job:
    name: Continues Delivery
    needs: [ ci-job ]
    uses: exasol/python-toolbox/.github/workflows/build-and-publish.yml@0.4.0
    secrets:
      PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

  metrics:
    needs: [ ci-job ]
    uses: exasol/python-toolbox/.github/workflows/report.yml@0.4.0

PR-Merge Workflow

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.4.0

  publish-docs:
    name: Publish Documentation
    uses: exasol/python-toolbox/.github/workflows/gh-pages.yml@0.4.0

  metrics:
    needs: [ ci-job ]
    uses: exasol/python-toolbox/.github/workflows/report.yml@0.4.0