feat: using entrypoint to start MAPDL (#4098) #12772
This file contains hidden or 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 | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
run_all_builds: | |
description: 'Run all extended MAPDL build tests' | |
required: true | |
type: boolean | |
push: | |
tags: | |
- "v*" | |
branches: | |
- main | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '30 4 * * *' | |
env: | |
ON_CI: True | |
PROJECT_NAME: 'PyMAPDL' | |
MAIN_PYTHON_VERSION: '3.12' | |
PACKAGE_NAME: 'ansys-mapdl-core' | |
PACKAGE_NAMESPACE: 'ansys.mapdl.core' | |
DOCUMENTATION_CNAME: 'mapdl.docs.pyansys.com' | |
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} | |
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: write | |
packages: read | |
pull-requests: write | |
issues: write | |
jobs: | |
update-changelog: | |
name: "Update CHANGELOG (on release)" | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: ansys/actions/[email protected] | |
with: | |
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
pull-request-name: | |
if: github.event_name == 'pull_request' | |
name: Check the name of the pull-request | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check pull-request name | |
uses: ansys/actions/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-style: | |
name: "Documentation style ${{ matrix.folder }}" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
folder: ["doc", "examples"] | |
steps: | |
- name: "Ansys documentation style checks" | |
uses: ansys/actions/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: ${{ matrix.folder }} | |
vale-config: ${{ matrix.folder }}/.vale.ini | |
vale-version: "3.4.1" | |
smoke-tests: | |
name: "${{ matrix.os }} | Py ${{ matrix.python-version }} | Rel ${{ matrix.should-release }}" | |
runs-on: ${{ matrix.os }} | |
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.10', '3.11', '3.12'] | |
# Only perform wheelhouse builds for macOS when releasing | |
should-release: | |
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }} | |
exclude: | |
- should-release: false | |
os: macos-latest | |
steps: | |
- name: "Build wheelhouse and perform smoke test" | |
id: build-wheelhouse | |
uses: ansys/actions/[email protected] | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
operating-system: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
check-licenses: true | |
- name: "Importing library" | |
run: | | |
${{ steps.build-wheelhouse.outputs.activate-venv }} | |
python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())" | |
- name: "Checking plotting support" | |
run: | | |
${{ steps.build-wheelhouse.outputs.activate-venv }} | |
python -c "from pyvista.plotting import system_supports_plotting; print('System support plotting ' + str(system_supports_plotting()))" | |
check-vulnerabilities: | |
name: "Check library vulnerabilities" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: ansys/actions/[email protected] | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
python-package-name: ${{ env.PACKAGE_NAME }} | |
dev-mode: ${{ github.ref != 'refs/heads/main' }} | |
upload-reports: True | |
hide-log: false | |
docs-build: | |
name: "Build documentation" | |
needs: doc-style | |
uses: ./.github/workflows/doc-build.yml | |
secrets: | |
license-server: ${{ secrets.LICENSE_SERVER }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
build-test-remote-matrix: | |
name: "Build remote test matrix" | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: "Install Git and checkout project" | |
uses: actions/[email protected] | |
- name: Build matrix for remote testing | |
uses: ./.github/actions/build-matrix | |
id: set-matrix | |
with: | |
token_teams_user_read: ${{ secrets.TOKEN_TEAMS_USER_READ }} | |
local: false | |
run_all_builds: ${{ inputs.run_all_builds }} | |
build-test-remote: | |
name: "Remote: ${{ matrix.mapdl-version }}" | |
needs: [smoke-tests, build-test-remote-matrix] | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.build-test-remote-matrix.outputs.matrix) }} | |
uses: ./.github/workflows/test-remote.yml | |
secrets: | |
license-server: ${{ secrets.LICENSE_SERVER }} | |
codecov-token: ${{ secrets.CODECOV_TOKEN }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
username: ${{ github.actor }} | |
with: | |
mapdl-version: "${{ matrix.mapdl-version }}" | |
file-name: "remote-${{ matrix.mapdl-version }}" | |
build-test-local-matrix: | |
name: "Build test matrix for minimal and local" | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: "Install Git and checkout project" | |
uses: actions/[email protected] | |
- name: Build matrix for local, minimal and console testing | |
uses: ./.github/actions/build-matrix | |
id: set-matrix | |
with: | |
token_teams_user_read: ${{ secrets.TOKEN_TEAMS_USER_READ }} | |
local: true | |
run_all_builds: ${{ inputs.run_all_builds }} | |
build-test-ubuntu-local: | |
name: "Local: ${{ matrix.mapdl-version }}" | |
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
needs: [smoke-tests, build-test-local-matrix] | |
uses: ./.github/workflows/test-local.yml | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.build-test-local-matrix.outputs.matrix) }} | |
secrets: | |
license-server: ${{ secrets.LICENSE_SERVER }} | |
codecov-token: ${{ secrets.CODECOV_TOKEN }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
username: ${{ github.actor }} | |
with: | |
testing-minimal: false | |
pytest-arguments: '--reset_only_failed --add_missing_images' | |
mapdl-version: ${{ matrix.mapdl-version }} | |
file-name: "local-${{ matrix.mapdl-version }}" | |
tags: "local" | |
latest-version: "252" | |
test_dpf: ${{ contains(matrix.mapdl-version, 'cicd') }} | |
build-test-ubuntu-minimal: | |
name: "Local-min: ${{ matrix.mapdl-version }}" | |
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
needs: [build-test-ubuntu-local, build-test-remote] | |
uses: ./.github/workflows/test-local.yml | |
strategy: | |
fail-fast: false | |
matrix: | |
mapdl-version: ['v25.2-ubuntu-cicd', 'v25.1-ubuntu'] | |
secrets: | |
license-server: ${{ secrets.LICENSE_SERVER }} | |
codecov-token: ${{ secrets.CODECOV_TOKEN }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
username: ${{ github.actor }} | |
with: | |
testing-minimal: true | |
pytest-arguments: '' | |
mapdl-version: ${{ matrix.mapdl-version }} | |
file-name: "${{ matrix.mapdl-version }}-minimal" | |
tags: "local,minimal" | |
latest-version: "252" | |
test_dpf: false | |
build-test-ubuntu-console: | |
name: "Local-min-console: ${{ matrix.mapdl-version }}" | |
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
needs: [build-test-ubuntu-local, build-test-remote] | |
uses: ./.github/workflows/test-local.yml | |
strategy: | |
fail-fast: false | |
matrix: | |
mapdl-version: ['v25.2-ubuntu-cicd', 'v25.1-ubuntu'] | |
secrets: | |
license-server: ${{ secrets.LICENSE_SERVER }} | |
codecov-token: ${{ secrets.CODECOV_TOKEN }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
username: ${{ github.actor }} | |
with: | |
latest-version: "252" | |
mapdl-version: ${{ matrix.mapdl-version }} | |
testing-minimal: false | |
on-console: true | |
pytest-arguments: '-k console' | |
file-name: "${{ matrix.mapdl-version }}-console" | |
tags: "local,console" | |
test_dpf: false | |
test-windows: | |
# Skipped | |
if: github.repository == '' | |
name: "Local: Build & test on Windows" | |
runs-on: [self-hosted, Windows, pymapdl] | |
timeout-minutes: 30 | |
env: | |
ON_LOCAL: TRUE | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/test_windows | |
with: | |
codecov_token: ${{ secrets.CODECOV_TOKEN }} | |
package: | |
name: "Package library" | |
needs: [build-test-remote, build-test-ubuntu-local, build-test-ubuntu-minimal, docs-build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Build library source and wheel artifacts" | |
uses: ansys/actions/[email protected] | |
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: [package, update-changelog] | |
runs-on: ubuntu-latest | |
# Specifying a GitHub environment is optional, but strongly encouraged | |
environment: release | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: "Download the library artifacts from build-library step" | |
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
with: | |
name: ${{ env.PACKAGE_NAME }}-artifacts | |
path: ${{ env.PACKAGE_NAME }}-artifacts | |
- name: "Display structure of downloaded files" | |
run: ls -Rla | |
- name: "Release to PyPI using trusted publisher" | |
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 | |
with: | |
repository-url: "https://upload.pypi.org/legacy/" | |
print-hash: true | |
packages-dir: ${{ env.PACKAGE_NAME }}-artifacts | |
skip-existing: false | |
- name: "Release to GitHub" | |
uses: ansys/actions/[email protected] | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
additional-artifacts: "minimum_requirements.txt" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload-docs-release: | |
name: "Upload release documentation" | |
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/[email protected] | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
render-last: '5' | |
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
upload-dev-docs: | |
name: "Upload dev documentation" | |
if: github.ref == 'refs/heads/main' && !contains(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
needs: [docs-build] | |
steps: | |
- name: "Deploy the latest documentation" | |
uses: ansys/actions/[email protected] | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
notify: | |
name: "Notify failed build" | |
needs: [smoke-tests, docs-build, build-test-remote, build-test-ubuntu-local, build-test-ubuntu-minimal] | |
if: failure() && github.event_name == 'schedule' | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Open issue" | |
uses: jayqi/failed-build-issue-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
title-template: "Failed scheduled build" | |
label-name: "Build failed" | |
test_julia: | |
name: "Julia ${{ matrix.julia-version }} | ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
strategy: | |
fail-fast: false | |
matrix: | |
julia-version: ['1.10.3', '1.10.4'] | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/[email protected] | |
- name: "Run Julia testing" | |
uses: ./.github/actions/test-julia | |
with: | |
julia-version: ${{ matrix.julia-version }} | |
pytest-summary: | |
name: Pytest summary for all the test jobs | |
needs: [ | |
build-test-remote, build-test-ubuntu-local, build-test-ubuntu-minimal, build-test-ubuntu-console | |
] | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Install Git and checkout project" | |
uses: actions/[email protected] | |
- name: "Run Pytest-summary action" | |
uses: ./.github/actions/pytest-summary | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} |