Skip to content

Commit 2f65008

Browse files
clatapieRobPasMue
andauthored
maint: technical review (#31)
Co-authored-by: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com>
1 parent 94f0978 commit 2f65008

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1206
-1742
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// I am using postStartCommand because postCreateCommand happens before the .gitconfig
2727
// file is copied in, preventing access to ansys-common-variableinterop for me. This
2828
// has the side-effect of running it every time you start the container, which
29-
// might not be what we want?
29+
// might not be what we want?
3030
"postStartCommand": "git config --list && poetry -vv install -E dev"
3131

3232
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
exclude = venv, __init__.py, doc/_build
2+
exclude = venv, __init__.py, doc/_build, .venv
33
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
44
count = True
55
max-complexity = 10

.github/dependabot.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,12 @@ updates:
33
- package-ecosystem: "pip"
44
directory: "/"
55
schedule:
6-
interval: "daily"
7-
versioning-strategy: "lockfile-only"
6+
interval: "weekly"
7+
labels:
8+
- "maintenance"
9+
- "dependencies"
10+
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 0 additions & 108 deletions
This file was deleted.

.github/workflows/cicd.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# check spelling, codestyle
2+
name: GitHub CI
3+
4+
on:
5+
workflow_dispatch:
6+
pull_request:
7+
push:
8+
tags:
9+
- "*"
10+
branches:
11+
- main
12+
13+
env:
14+
DOCUMENTATION_CNAME: 'engineeringworkflow.docs.pyansys.com'
15+
MAIN_PYTHON_VERSION: '3.11'
16+
PACKAGE_NAME: 'ansys-engineeringworkflow-api'
17+
PACKAGE_NAMESPACE: 'ansys.engineeringworkflow.api'
18+
19+
jobs:
20+
code-style:
21+
name: "Code style"
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: PyAnsys code style checks
25+
uses: ansys/actions/code-style@v5
26+
with:
27+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
28+
29+
doc-style:
30+
name: "Documentation Style Check"
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: PyAnsys documentation style checks
34+
uses: ansys/actions/doc-style@v5
35+
with:
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
38+
smoke-tests:
39+
name: "Build and Smoke tests"
40+
runs-on: ${{ matrix.os }}
41+
needs: [code-style]
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
os: [ubuntu-latest, windows-latest, macos-latest]
46+
python-version: ['3.9', '3.10', '3.11', '3.12']
47+
should-release:
48+
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
49+
exclude:
50+
- should-release: false
51+
os: macos-latest
52+
53+
steps:
54+
- name: Build wheelhouse and perform smoke test
55+
uses: ansys/actions/build-wheelhouse@v5
56+
with:
57+
library-name: ${{ env.PACKAGE_NAME }}
58+
operating-system: ${{ matrix.os }}
59+
python-version: ${{ matrix.python-version }}
60+
61+
build-test:
62+
name: "Build and unit testing"
63+
runs-on: ubuntu-latest
64+
needs: [smoke-tests]
65+
steps:
66+
- name: Run pytest
67+
uses: ansys/actions/tests-pytest@v5
68+
with:
69+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
70+
pytest-extra-args: -v --durations=10 --maxfail=10 --cov=${{ env.PACKAGE_NAMESPACE }} --cov-report=xml:coverage.xml --cov-report=html --cov-report term
71+
72+
- name: "Upload coverage to Codecov"
73+
uses: codecov/codecov-action@v4
74+
with:
75+
files: coverage.xml
76+
77+
- name: "Upload coverage artifacts"
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: coverage-html
81+
path: htmlcov
82+
83+
doc-build:
84+
name: "Documentation building"
85+
runs-on: ubuntu-latest
86+
needs: [doc-style]
87+
steps:
88+
- name: "Run Ansys documentation building action"
89+
uses: ansys/actions/doc-build@v5
90+
with:
91+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
92+
93+
package:
94+
name: Package library
95+
needs: [doc-build, build-test]
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Build library source and wheel artifacts
99+
uses: ansys/actions/build-library@v5
100+
with:
101+
library-name: ${{ env.PACKAGE_NAME }}
102+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
103+
104+
doc-deploy-dev:
105+
name: "Deploy development documentation"
106+
# Deploy development only when merging to main
107+
if: github.ref == 'refs/heads/main'
108+
runs-on: ubuntu-latest
109+
needs: [package]
110+
steps:
111+
- name: "Deploy the latest documentation"
112+
uses: ansys/actions/doc-deploy-dev@v5
113+
with:
114+
cname: ${{ env.DOCUMENTATION_CNAME }}
115+
token: ${{ secrets.GITHUB_TOKEN }}
116+
117+
release:
118+
name: "Release project to public PyPI and GitHub"
119+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
120+
needs: [package]
121+
runs-on: ubuntu-latest
122+
steps:
123+
124+
- name: "Release to the public PyPI repository"
125+
uses: ansys/actions/release-pypi-public@v5
126+
with:
127+
library-name: ${{ env.PACKAGE_NAME }}
128+
twine-username: "__token__"
129+
twine-token: ${{ secrets.PYPI_TOKEN }}
130+
131+
- name: "Release to GitHub"
132+
uses: ansys/actions/release-github@v5
133+
with:
134+
library-name: ${{ env.PACKAGE_NAME }}
135+
136+
doc-deploy-stable:
137+
name: "Deploy stable documentation"
138+
# Deploy release documentation when creating a new tag
139+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
140+
runs-on: ubuntu-latest
141+
needs: [release]
142+
steps:
143+
- name: "Deploy the stable documentation"
144+
uses: ansys/actions/doc-deploy-stable@v5
145+
with:
146+
cname: ${{ env.DOCUMENTATION_CNAME }}
147+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)