MAINT: Bump ansys/actions from 5 to 6 #204
Workflow file for this run
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 | |
# run only on main branch. This avoids duplicated actions on PRs | |
on: | |
pull_request: | |
push: | |
tags: | |
- "*" | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
MAIN_PYTHON_VERSION: "3.10" | |
PACKAGE_NAME: "ansys-workbench-core" | |
PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/' | |
DOCUMENTATION_CNAME: 'workbench.docs.pyansys.com' | |
jobs: | |
code-style: | |
name: "Code style" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: ansys/actions/code-style@v6 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
doc-style: | |
name: "Documentation Style Check" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Running documentation style checks" | |
uses: ansys/actions/doc-style@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-build: | |
name: "Build documentation" | |
runs-on: ubuntu-latest | |
needs: [doc-style] | |
steps: | |
- name: "Checkout project" | |
uses: actions/checkout@v4 | |
- name: "Install Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: "Install project with doc dependencies" | |
run: | | |
sudo apt update | |
sudo apt-get install -y build-essential texlive-latex-extra latexmk texlive-pstricks | |
python -m pip install .[doc] | |
- name: "Install custom sphinx-autoapi branch" | |
run: | | |
python -m pip install \ | |
"sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi@feat/single-page-stable" | |
- name: "Build HTML documentation" | |
run: | | |
make -C doc html | |
- name: "Build PDF documentation" | |
run: | | |
make -C doc pdf | |
- name: "Upload HTML documentation artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: documentation-html | |
path: doc/_build/html | |
retention-days: 7 | |
- name: "Upload PDF documentation artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: documentation-pdf | |
path: doc/_build/latex/*.pdf | |
retention-days: 7 | |
# TODO: restore these step in favor of previous ones this PR is merged | |
# https://github.com/readthedocs/sphinx-autoapi/pull/399 | |
# | |
# - uses: ansys/actions/doc-build@v4 | |
# with: | |
# python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
build-wheelhouse: | |
name: "Build wheelhouse for latest Python versions" | |
runs-on: ${{ matrix.os }} | |
needs: [code-style] | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
steps: | |
- name: "Build a wheelhouse for ${{ matrix.python-version }}" | |
uses: ansys/actions/build-wheelhouse@v6 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
operating-system: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
build-library: | |
name: "Build library" | |
runs-on: ubuntu-latest | |
needs: [build-wheelhouse, doc-build] | |
steps: | |
- uses: ansys/actions/build-library@v6 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
release: | |
name: Release project | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
needs: [build-library] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Release to the private PyPI repository | |
uses: ansys/actions/release-pypi-private@v6 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
twine-username: "__token__" | |
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} | |
- name: Release to GitHub | |
uses: ansys/actions/release-github@v6 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
doc-deploy-dev: | |
name: "Deploy development documentation" | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: doc-build | |
steps: | |
- uses: ansys/actions/doc-deploy-dev@v6 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-deploy-stable: | |
name: "Deploy stable docs" | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Deploy the stable documentation | |
uses: ansys/actions/doc-deploy-stable@v6 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} |