Skip to content

Revert required MI version bump to 2024 R2 #1042

Revert required MI version bump to 2024 R2

Revert required MI version bump to 2024 R2 #1042

Workflow file for this run

name: CI
on:
pull_request:
push:
tags:
- "*"
branches:
- main
workflow_dispatch:
inputs:
publish-to-private-pypi:
description: Whether to publish the build to the private PyPI
type: choice
options:
- 'true'
- 'false'
default: 'false'
env:
MAIN_PYTHON_VERSION: '3.12'
DOCUMENTATION_CNAME: 'recordlists.grantami.docs.pyansys.com'
LIBRARY_NAME: 'ansys-grantami-recordlists'
LIBRARY_NAMESPACE: 'ansys.grantami.recordlists'
# PIP_INDEX_URL: "https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/"
# POETRY_HTTP_BASIC_PRIVATE_PYPI_USERNAME: "PAT"
# POETRY_HTTP_BASIC_PRIVATE_PYPI_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
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:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
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 artifacts"
uses: actions/upload-artifact@v4
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && matrix.os == 'ubuntu-latest' && !startsWith( github.event.pull_request.head.ref, 'dependabot/') }}
with:
name: coverage-html-unittests
path: .cov/html
retention-days: 7
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v5
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && matrix.os == 'ubuntu-latest' && !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: [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 }}
release-private-pypi:
name: "Publish dev build to private PyPI"
runs-on: ubuntu-latest
needs: [ server-checks ]
if: (github.event_name == 'workflow_dispatch') && (github.ref == 'refs/heads/main') && (inputs.publish-to-private-pypi == 'true')
steps:
- name: "Release to private PyPI"
uses: ansys/actions/release-pypi-private@v8
with:
library-name: ${{ env.LIBRARY_NAME }}
twine-username: "__token__"
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
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 }}