Skip to content

Commit

Permalink
Merge pull request #257 from ansys/fix/tech-review
Browse files Browse the repository at this point in the history
FIX: tech review
  • Loading branch information
mariostieriansys authored Jul 27, 2023
2 parents d5b4783 + c3806b3 commit 6d4c953
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 46 deletions.
63 changes: 30 additions & 33 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,32 @@ concurrency:
cancel-in-progress: true

jobs:
style:
name: Code style

code-style:
name: "Code style"
runs-on: ubuntu-latest
steps:
- name: PyAnsys code style checks
uses: ansys/actions/code-style@v4
- uses: ansys/actions/code-style@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

docs-style:
name: Documentation Style Check
doc-style:
name: "Doc style"
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
uses: ansys/actions/doc-style@v4
- uses: ansys/actions/doc-style@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

smoke-tests:
name: Build and Smoke tests
name: "Wheelhouse for ${{ matrix.os }} and ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
needs: [style]
needs: code-style
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
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
uses: ansys/actions/build-wheelhouse@v4
Expand All @@ -64,11 +58,15 @@ jobs:
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

build_and_test:
name: Build & test
tests:
name: "Test ${{ matrix.python-version }} with ${{ matrix.os }}"
needs: [smoke-tests]
runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -85,16 +83,16 @@ jobs:
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}
requires-xvfb: true

- uses: codecov/codecov-action@v3
name: 'Upload coverage to CodeCov'

docs:
name: Build docs
doc:
name: "Doc build"
runs-on: ubuntu-latest
needs: [smoke-tests]
needs: doc-style
steps:
- uses: actions/checkout@v3

Expand All @@ -115,13 +113,12 @@ jobs:
with:
sphinxopts: '-j auto'

package:
name: Package library
needs: [build_and_test, docs]
build-library:
name: "Build library"
needs: [doc, tests]
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
uses: ansys/actions/build-library@v4
- uses: ansys/actions/build-library@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
Expand All @@ -130,7 +127,7 @@ jobs:
name: "Deploy development documentation"
# Deploy development only when merging to main
if: github.ref == 'refs/heads/main'
needs: [package]
needs: build-library
runs-on: ubuntu-latest
steps:
- name: "Deploy the latest documentation"
Expand All @@ -142,7 +139,7 @@ jobs:
release:
name: Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [package]
needs: build-library
runs-on: ubuntu-latest
steps:
# Upload first to the private PyPi, at least up until we release
Expand All @@ -169,7 +166,7 @@ jobs:
# Deploy release documentation when creating a new tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [package]
needs: release
steps:
- name: "Deploy the stable documentation"
uses: ansys/actions/doc-deploy-stable@v4
Expand All @@ -180,7 +177,7 @@ jobs:
build-failure:
name: Teams notify on failure
if: failure() && (github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref_type == 'tag')
needs: [smoke-tests, build_and_test ]
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
24 changes: 11 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ dev = [
"dill>=0.3.5.1",
"pre-commit>=3.3.3",
]

tests = [
"pytest==7.1.2",
"pytest-cov==3.0.0",
Expand All @@ -55,7 +54,6 @@ tests = [
"requests>=2.28.2",
"pyansys-docker>=5.0.4",
]

doc = [
"Sphinx==7.0.1",
"numpydoc==1.5.0",
Expand All @@ -71,6 +69,16 @@ doc = [
"sphinxcontrib-openapi==0.8.1"
]

[project.urls]
Documentation = "https://ensight.docs.pyansys.com/"
Homepage = "https://github.com/ansys/pyensight"
Source = "https://github.com/ansys/pyensight"
Tracker = "https://github.com/ansys/pyensight/issues"
Changelog = "https://github.com/ansys/pyensight/blob/main/CHANGELOG.rst"

[tool.flit.module]
name = "ansys.pyensight.core"

[tool.coverage.run]
branch = true

Expand All @@ -91,16 +99,6 @@ show_missing = true
[tool.coverage.html]
show_contexts = true

[project.urls]
Documentation = "https://ensight.docs.pyansys.com/"
Homepage = "https://github.com/ansys/pyensight"
Source = "https://github.com/ansys/pyensight"
Tracker = "https://github.com/ansys/pyensight/issues"
Changelog = "https://github.com/ansys/pyensight/blob/main/CHANGELOG.rst"

[tool.flit.module]
name = "ansys.pyensight.core"

[tool.black]
line-length = 100
src_paths = ["src/ansys", "doc"]
Expand Down Expand Up @@ -169,4 +167,4 @@ module = ["grpc",
ignore_missing_imports = true

[pydocstyle]
convention = "numpy"
convention = "numpy"

0 comments on commit 6d4c953

Please sign in to comment.