Mostieri/testing #29
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: GitHub CI | |
# run only on main branch. This avoids duplicated actions on PRs | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
tags: | |
- "*" | |
branches: | |
- main | |
env: | |
MAIN_PYTHON_VERSION: '3.10' | |
PACKAGE_NAME: 'ansys-tools-omniverse' | |
PACKAGE_NAMESPACE: 'ansys.tools.omniverse' | |
ENSIGHT_IMAGE: 'ghcr.io/ansys-internal/ensight_dev' | |
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@v7 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
doc-style: | |
name: "Doc style" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: ansys/actions/doc-style@v7 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
smoke-tests: | |
name: "Wheelhouse for ${{ matrix.os }} and ${{ matrix.python-version }}" | |
runs-on: ${{ matrix.os }} | |
needs: code-style | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ['3.10'] | |
should-release: | |
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }} | |
steps: | |
- name: Build wheelhouse and perform smoke test | |
uses: ansys/actions/build-wheelhouse@v7 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
library-namespace: ${{ env.PACKAGE_NAMESPACE }} | |
operating-system: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
tests: | |
name: "Test ${{ matrix.python-version }} with ${{ matrix.os }}" | |
needs: [smoke-tests] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.10'] | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: docker | |
run: docker pull ${{ env.ENSIGHT_IMAGE }} | |
- name: Run pytest | |
uses: ansys/actions/tests-pytest@v7 | |
env: | |
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} | |
with: | |
python-version: ${{ matrix.python-version }} | |
requires-xvfb: true | |
- uses: codecov/codecov-action@v3 | |
name: 'Upload coverage to CodeCov' | |
build-library: | |
name: "Build library" | |
needs: [tests] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: ansys/actions/build-library@v7 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
release: | |
name: Release | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
needs: build-library | |
runs-on: ubuntu-latest | |
steps: | |
# Upload first to the private PyPi, at least up until we release | |
- name: Release to the private PyPI repository | |
uses: ansys/actions/release-pypi-private@v7 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} | |
- name: Release to the public PyPI repository | |
uses: ansys/actions/release-pypi-public@v7 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} | |
twine-username: "__token__" | |
twine-token: ${{ secrets.PYPI_TOKEN }} | |
- name: Release to GitHub | |
uses: ansys/actions/release-github@v7 | |
with: | |
library-name: ${{ env.PACKAGE_NAME }} |