CI #10
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
name: CI | |
concurrency: python-ci | |
on: | |
push: | |
branches: [develop] | |
paths: | |
- "src/**" | |
- "tests/**" | |
- setup.cfg | |
- setup.py | |
- tox.ini | |
- "requirements/*.txt" | |
- "docs/**" | |
workflow_run: | |
workflows: ["Update Requirements"] | |
types: [completed] | |
workflow_dispatch: | |
repository_dispatch: | |
types: | |
- common-published | |
jobs: | |
tests: | |
name: Build/test on ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
concurrency: ci | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Linux | |
os: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get language version | |
id: get_lang_version | |
run: | | |
v=$(cat .python-version) | |
echo "lang_version=$v" >> $GITHUB_OUTPUT | |
t=$(cat .tox-env) | |
echo "tox_env=$t" >> $GITHUB_OUTPUT | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ steps.get_lang_version.outputs.lang_version }} | |
- name: update-pip | |
run: | | |
pip install -U wheel | |
pip install -U setuptools | |
python -m pip install -U pip | |
- name: get-pip-cache-dir | |
id: pip-cache | |
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: cache-pip | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: pip|${{ runner.os }}|${{ steps.get_lang_version.outputs.lang_version }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }} | |
- name: install-utils | |
run: pip install tox | |
- name: tests | |
run: | | |
tox -e ${{ steps.get_lang_version.outputs.tox_env }} | |
docs: | |
needs: [tests] | |
runs-on: ubuntu-latest | |
concurrency: docs | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get language version | |
id: get_lang_version | |
run: | | |
v=$(cat .python-version) | |
echo "lang_version=$v" >> $GITHUB_OUTPUT | |
t=$(cat .tox-env) | |
echo "tox_env=$t" >> $GITHUB_OUTPUT | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ steps.get_lang_version.outputs.lang_version }} | |
- name: install-deps | |
run: pip install -r requirements/docs.txt | |
- name: make-docs | |
run: cd docs && make html | |
- name: publish-docs | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/_build/html | |
destination_dir: python | |
publish: | |
needs: [tests] | |
runs-on: ubuntu-latest | |
concurrency: publish | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# - name: Build a binary wheel and a source tarball | |
# run: | | |
# python3 -m pip install build --user | |
# python3 -m build | |
# - name: Store the distribution packages | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: python-package-distributions | |
# path: dist/ | |
# - name: publish | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
- name: publish | |
uses: relekang/[email protected] | |
with: | |
additional_options: "--patch" | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repository_username: __token__ | |
repository_password: ${{ secrets.PYPI_TOKEN }} | |
notify: | |
needs: [publish] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- repo: api-core | |
- repo: catalog-api | |
- repo: catalog-data | |
- repo: catalog-data-processor | |
- repo: catalog-objects | |
- repo: catalog-web | |
- repo: client | |
- repo: data-api | |
- repo: data-objects | |
- repo: db | |
- repo: initiative-api | |
- repo: initiative-data | |
- repo: initiative-objects | |
- repo: initiative-web | |
- repo: kv-api | |
- repo: kv-data | |
- repo: kv-expression-processor | |
- repo: kv-key-processor | |
- repo: kv-objects | |
- repo: kv-value-calculator | |
- repo: kv-web | |
- repo: library-api | |
- repo: library-data | |
- repo: library-objects | |
- repo: library-web | |
- repo: main-web | |
- repo: model-core | |
- repo: shared-web | |
- repo: web-core | |
steps: | |
- uses: juztcode/repo-ditpatch-action@v1 | |
continue-on-error: true | |
with: | |
event-type: model-core-published | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
repository: sweetrpg/${{ matrix.repo }} |