Launcher: implement gRPC transport option handling #618
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: GitHub CI | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - main | |
| env: | |
| PACKAGE_NAME: ansys-tools-common | |
| MAIN_PYTHON_VERSION: 3.13 | |
| DOCUMENTATION_CNAME: tools.docs.pyansys.com | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| changelog: | |
| name: Changelog | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Create fragment | |
| if: github.event_name == 'pull_request' | |
| uses: ansys/actions/doc-changelog@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
| bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
| - name: Deploy changelog | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
| uses: ansys/actions/doc-deploy-changelog@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
| bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
| vulnerabilities: | |
| name: Check library vulnerabilities | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ansys/actions/check-vulnerabilities@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| 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' }} | |
| code-style: | |
| name: Code style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ansys/actions/code-style@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| doc-style: | |
| name: Doc style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ansys/actions/doc-style@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| actions-style: | |
| name: Actions style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ansys/actions/check-actions-security@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| generate-summary: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| auditing-level: high | |
| wheelhouse: | |
| name: Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| needs: code-style | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python: ['3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: ansys/actions/build-wheelhouse@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| library-name: ${{ env.PACKAGE_NAME }} | |
| operating-system: ${{ matrix.os }} | |
| python-version: ${{ matrix.python }} | |
| whitelist-license-check: termcolor # Has MIT license, but it's not recognized | |
| tests: | |
| name: Testing | |
| runs-on: ubuntu-latest | |
| needs: wheelhouse | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python: ['3.10', '3.11', '3.12', '3.13'] | |
| env: | |
| ANSYS_LOCAL: false | |
| ON_UBUNTU: true | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@5a7eac68fb9809dea845d802897dc5c723910fa3 # 7.1.3 | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| enable-cache: false | |
| - name: Install project dependencies | |
| run: | | |
| uv sync --group tests | |
| - name: Install test package containing entrypoint | |
| run: | | |
| uv pip install tests/launcher/pkg_with_entrypoint | |
| - name: Run tests | |
| run: | | |
| uv run pytest | |
| doc-build: | |
| name: Build documentation | |
| needs: doc-style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ansys/actions/doc-build@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| check-links: false | |
| group-dependencies-name: doc | |
| build-library: | |
| name: Build library | |
| runs-on: ubuntu-latest | |
| needs: [doc-build, tests] | |
| steps: | |
| - uses: ansys/actions/build-library@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| 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, changelog] | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: ${{ env.PACKAGE_NAME }}-artifacts | |
| path: ${{ env.PACKAGE_NAME }}-artifacts | |
| - name: Release to the public PyPI | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 | |
| 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/release-github@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| library-name: ${{ env.PACKAGE_NAME }} | |
| doc-deploy-dev: | |
| name: Deploy dev docs | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| needs: build-library | |
| steps: | |
| - uses: ansys/actions/doc-deploy-dev@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| cname: ${{ env.DOCUMENTATION_CNAME }} | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
| bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
| doc-deploy-stable: | |
| name: Deploy stable docs | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
| runs-on: ubuntu-latest | |
| needs: release | |
| steps: | |
| - uses: ansys/actions/doc-deploy-stable@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| cname: ${{ env.DOCUMENTATION_CNAME }} | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
| bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
| automerge-prs: | |
| name: Automerge PRs (dependabot and pre-commit.ci only) | |
| runs-on: ubuntu-latest | |
| needs: [build-library] | |
| if: github.event_name == 'pull_request' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Automerge PRs | |
| uses: ansys/actions/hk-automerge-prs@21c9de9bee9692173780696d4a39964f20b9cfa3 # v10.1.5 | |
| with: | |
| approver: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
| approver-token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| - name: If pre-commit PR, add assignee | |
| if: startsWith(github.head_ref, 'pre-commit-ci-update-config') | |
| run: gh pr edit --add-assignee pyansys-ci-bot "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GH_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} |