Skip to content

Update dev version. #1916

Update dev version.

Update dev version. #1916

name: Templates Python
on:
pull_request:
push:
tags:
- "*"
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: ${{ matrix.cfg.template }} / ${{ matrix.cfg.build-system }} / ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.11"]
include:
- python-version: "3.9"
toxenv: py39
toxextra: keep-output
- python-version: "3.11"
toxenv: py311
toxextra: keep-output
cfg:
# All pybasic template tests
- {name: "doc-project", template: "doc-project", build-system: "flit", outdir: "doc_proje0/doc-project"}
- {name: "doc-project", template: "doc-project", build-system: "poetry", outdir: "doc_proje1/doc-project"}
- {name: "doc-project", template: "doc-project", build-system: "setuptools", outdir: "doc_proje2/doc-project"}
# All pybasic template tests
- {name: "pybasic", template: "pybasic", build-system: "setuptools", outdir: "pybasic_s0/pybasic"}
# All pybasic template tests
- {name: "pyansys", template: "pyansys", build-system: "setuptools", outdir: "pyansys_s0/pyproduct-library"}
# # All pyansys_advanced template tests
- {name: "pyansys-advanced-flit", template: "pyansys-advanced", build-system: "flit", outdir: "pyansys_a0/pyproduct-library"}
- {name: "pyansys-advanced-poetry", template: "pyansys-advanced", build-system: "poetry", outdir: "pyansys_a1/pyproduct-library"}
- {name: "pyansys-advanced-setuptools", template: "pyansys-advanced", build-system: "setuptools", outdir: "pyansys_a2/pyproduct-library"}
# # All pyace template tests
- {name: "pyace-pkg", template: "pyace", build-system: "setuptools", outdir: "pyace_set0/project"}
- {name: "pyace-flask", template: "pyace-flask", build-system: "setuptools", outdir: "pyace_fla2/project"}
- {name: "pyace-fast", template: "pyace-fast", build-system: "setuptools", outdir: "pyace_fas2/project"}
- {name: "pyace-grpc", template: "pyace-grpc", build-system: "setuptools", outdir: "pyace_grp2/project"}
# All solution template tests
- {name: "solution", template: "solution", build-system: "poetry", outdir: "solution_1/solution"}
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Bake ${{ matrix.cfg.template }}
run: |
export TEMPLATE=${{ matrix.cfg.template }}
tox -e ${{ matrix.toxenv }}-${{ matrix.toxextra }}-template
- name: Move baked project to repo again
if: matrix.python-version == '3.9' && github.event_name == 'push'
run: |
mv "output/test_template_python_${{ matrix.cfg.outdir }}" baked_template
# GitHub Apps are not allowed to deal with .github workflows
if [ -d "baked_template/.github" ]; then mv baked_template/.github baked_template/.github_demo; fi
ls -a baked_template
- name: Create demo branch
if: matrix.python-version == '3.9' && github.event_name == 'push'
uses: peterjgrainger/action-create-branch@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: "demo/${{ matrix.cfg.name }}"
- name: Publish demo branch
if: matrix.python-version == '3.9' && github.event_name == 'push'
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: "demo/${{ matrix.cfg.name }}"
FOLDER: "baked_template"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}