Update stated Python requirement (#656) #1721
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: Pre-merge checks | |
on: | |
pull_request: | |
push: | |
tags: | |
- "*" | |
branches: | |
- main | |
workflow_dispatch: | |
merge_group: | |
env: | |
MAIN_PYTHON_VERSION: '3.12' | |
DOCUMENTATION_CNAME: 'bomanalytics.grantami.docs.pyansys.com' | |
LIBRARY_NAME: 'ansys-grantami-bomanalytics' | |
LIBRARY_NAMESPACE: 'ansys.grantami.bomanalytics' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code-style: | |
name: "Code style" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: ansys/actions/code-style@v8 | |
with: | |
skip-install: false | |
doc-style: | |
name: "Documentation style" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: ansys/actions/doc-style@v8 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-build: | |
name: Documentation Build (mock examples) | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Run Ansys documentation building action" | |
uses: ansys/actions/doc-build@v8 | |
with: | |
check-links: false | |
dependencies: "pandoc" | |
sphinxopts: "-n -W --keep-going" | |
- name: "Delete unneeded doc artifact" | |
if: ${{ !startsWith( github.event.pull_request.head.ref, 'dependabot/') }} | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: | | |
documentation-html | |
documentation-pdf | |
smoke-tests: | |
name: "Build wheelhouse for latest Python versions" | |
runs-on: ${{ matrix.os }} | |
needs: code-style | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- uses: ansys/actions/build-wheelhouse@v8 | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
operating-system: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
tests: | |
name: "Tests Python ${{ matrix.python-version }}, ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
needs: smoke-tests | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
fail-fast: false | |
steps: | |
- name: "Checkout the repository" | |
uses: actions/checkout@v4 | |
- name: "Set up Python ${{ matrix.python-version }}" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: "Install Python dependencies" | |
run: | | |
python -m pip install --upgrade pip poetry tox | |
- name: "Test with tox" | |
run: tox -e "tests" -- -m "not integration" | |
- name: "Upload coverage to Codecov" | |
uses: codecov/codecov-action@v5 | |
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && !startsWith( github.event.pull_request.head.ref, 'dependabot/') }} | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: .cov/xml | |
flags: unittests | |
fail_ci_if_error: true | |
build-library: | |
name: "Build library" | |
runs-on: ubuntu-latest | |
needs: [ doc-build, tests] | |
steps: | |
- uses: ansys/actions/build-library@v8 | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
server-checks: | |
name: "Server checks" | |
needs: [ smoke-tests ] | |
if: ${{ !startsWith( github.event.pull_request.head.ref, 'dependabot/') }} | |
uses: ./.github/workflows/server_checks.yml | |
with: | |
skip-vm-management: ${{ vars.SKIP_VM_MANAGEMENT == 'true' }} | |
secrets: | |
inherit | |
doc-deploy-dev: | |
name: "Deploy development documentation" | |
runs-on: ubuntu-latest | |
needs: [server-checks] | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags') | |
steps: | |
- uses: ansys/actions/doc-deploy-dev@v8 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-artifact-name: documentation-html | |
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
update-changelog: | |
name: "Update CHANGELOG for new tag" | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: ansys/actions/doc-deploy-changelog@v8 | |
with: | |
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
release: | |
name: "Release" | |
runs-on: ubuntu-latest | |
needs: [build-library, server-checks, update-changelog] | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
environment: release | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: ansys/actions/release-pypi-public@v8 | |
name: "Release to public PyPI" | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
use-trusted-publisher: true | |
- uses: ansys/actions/release-github@v8 | |
name: "Release to GitHub" | |
with: | |
library-name: ${{ env.LIBRARY_NAME }} | |
doc-deploy-stable: | |
name: "Deploy stable documentation" | |
runs-on: ubuntu-latest | |
needs: release | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
steps: | |
- uses: ansys/actions/doc-deploy-stable@v8 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-artifact-name: documentation-html | |
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} |