Solved: #29 #67
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
# -*- coding: utf-8 -*- | |
# Copyright (C) 2023 Benjamin Thomas Schwertfeger | |
# GitHub: https://github.com/btschwertfeger | |
# | |
# Workflow to apply pre-commit, build, test | |
name: CI/CD | |
on: | |
push: | |
branches: | |
- "**" | |
schedule: | |
- cron: "20 15 * * 0" | |
release: | |
types: [created] | |
concurrency: | |
group: CICD-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
## Checks the code logic, style and more | |
## | |
Pre-Commit: | |
uses: ./.github/workflows/_pre_commit.yaml | |
## Builds the package on multiple OS for multiple | |
## Python versions | |
## | |
Build: | |
needs: [Pre-Commit] | |
uses: ./.github/workflows/_build.yaml | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: ["3.11", "3.13"] | |
with: | |
os: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
## Build the documentation | |
## | |
Build-Doc: | |
needs: [Pre-Commit] | |
uses: ./.github/workflows/_build_doc.yaml | |
## Run the unit tests for Python 3.11 and 3.13 | |
## | |
Test: | |
needs: [Pre-Commit] | |
uses: ./.github/workflows/_test.yaml | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: ["3.11", "3.13"] | |
with: | |
os: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
## Uploads the package to test.pypi.org on master if triggered by | |
## a regular commit/push. | |
## | |
UploadTestPyPI: | |
if: | | |
(success() && github.ref == 'refs/heads/master') | |
&& (github.event_name == 'push' || github.event_name == 'release') | |
needs: | |
- Build | |
- Build-Doc | |
- Test | |
name: Upload development version to Test PyPI | |
uses: ./.github/workflows/_pypi_test_publish.yaml | |
secrets: | |
API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
## Upload genai to PyPI | |
## | |
UploadPyPI: | |
if: | | |
success() | |
&& github.actor == 'LeonhardSchwertfeger' | |
&& github.event_name == 'release' | |
needs: | |
- Build | |
- Build-Doc | |
- Test | |
name: Upload release to PyPI | |
uses: ./.github/workflows/_pypi_publish.yaml | |
secrets: | |
API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |