Skip to content

Commit e0c2c00

Browse files
authored
Merge branch 'main' into refactor/typing_workflow_record
2 parents dc613f7 + 28c1d07 commit e0c2c00

File tree

83 files changed

+9045
-1021
lines changed

Some content is hidden

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

83 files changed

+9045
-1021
lines changed

.ci/generate_operators_doc.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,20 @@ def initialize_server(ansys_path=None, include_composites=False, include_sound=F
2020
if include_composites:
2121
print("Loading Composites Plugin")
2222
load_library(
23-
Path(server.ansys_path)
23+
filename=Path(server.ansys_path)
2424
/ "dpf"
2525
/ "plugins"
2626
/ "dpf_composites"
27-
/ "composite_operators.dll"
27+
/ "composite_operators.dll",
28+
name="composites",
2829
)
2930
if include_sound:
3031
print("Loading Acoustics Plugin")
31-
load_library(Path(server.ansys_path) / "Acoustics" / "SAS" / "ads" / "dpf_sound.dll")
32+
load_library(
33+
filename=Path(server.ansys_path) / "Acoustics" / "SAS" / "ads" / "dpf_sound.dll",
34+
name="sound",
35+
)
36+
print(f"Loaded plugins: {list(server.plugins.keys())}")
3237
return server
3338

3439

.github/workflows/ci.yml

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened, ready_for_review, closed, labeled]
5+
types: [opened, synchronize, reopened, ready_for_review]
66
branches-ignore:
77
- '*no-ci*'
88
push:
@@ -31,16 +31,14 @@ env:
3131
jobs:
3232
debug:
3333
runs-on: ubuntu-latest
34-
if: github.event.action != 'closed'
3534
steps:
36-
- name: Show the Github context for the triggered event
35+
- name: Show the GitHub context for the triggered event
3736
run: echo "$GITHUB_CONTEXT"
3837
env:
3938
GITHUB_CONTEXT: ${{ toJson(github) }}
4039

4140
pick_server_suffix:
4241
runs-on: ubuntu-latest
43-
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
4442
outputs:
4543
suffix: ${{ steps.step1.outputs.suffix }}
4644
steps:
@@ -71,7 +69,6 @@ jobs:
7169
style:
7270
name: "Style Check"
7371
runs-on: ubuntu-latest
74-
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
7572
steps:
7673
- uses: ansys/actions/code-style@v8
7774
with:
@@ -80,7 +77,6 @@ jobs:
8077
build_linux1:
8178
name: "Build linux1 wheel"
8279
runs-on: ubuntu-latest
83-
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
8480
steps:
8581
- uses: actions/checkout@v4
8682

@@ -111,7 +107,6 @@ jobs:
111107
matrix:
112108
test-any: ['false', 'true']
113109
uses: ./.github/workflows/tests.yml
114-
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
115110
needs: pick_server_suffix
116111
with:
117112
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
@@ -126,7 +121,6 @@ jobs:
126121
docker_tests:
127122
name: "Build and Test on Docker"
128123
uses: ./.github/workflows/test_docker.yml
129-
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
130124
needs: pick_server_suffix
131125
with:
132126
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
@@ -136,7 +130,6 @@ jobs:
136130
docker_examples:
137131
name: "Run examples on Docker"
138132
uses: ./.github/workflows/examples_docker.yml
139-
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
140133
needs: pick_server_suffix
141134
with:
142135
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
@@ -146,8 +139,6 @@ jobs:
146139

147140
docs:
148141
if: |
149-
github.event.action != 'closed' &&
150-
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
151142
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
152143
uses: ./.github/workflows/docs.yml
153144
needs: pick_server_suffix
@@ -158,31 +149,9 @@ jobs:
158149
python_version: "3.11"
159150
secrets: inherit
160151

161-
doc-deploy-pr:
162-
name: "Deploy PR documentation"
163-
runs-on: ubuntu-latest
164-
needs: docs
165-
if: |
166-
always() &&
167-
github.event.pull_request.draft != true &&
168-
(needs.docs.result == 'success' || needs.docs.result == 'skipped') &&
169-
contains(github.event.pull_request.labels.*.name, 'deploy-pr-doc')
170-
steps:
171-
- uses: ansys/actions/doc-deploy-pr@v10
172-
with:
173-
cname: ${{ env.DOCUMENTATION_CNAME }}
174-
token: ${{ secrets.GITHUB_TOKEN }}
175-
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
176-
decompress-artifact: true
177-
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
178-
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
179-
maximum-pr-doc-deployments: 10
180-
181152
upload-development-docs:
182153
runs-on: ubuntu-latest
183154
if: |
184-
github.event.action != 'closed' &&
185-
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
186155
(github.ref == 'refs/heads/main' && github.event_name == 'push')
187156
needs: [docs]
188157
steps:
@@ -198,8 +167,6 @@ jobs:
198167

199168
examples:
200169
if: |
201-
github.event.action != 'closed' &&
202-
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
203170
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
204171
uses: ./.github/workflows/examples.yml
205172
needs: pick_server_suffix
@@ -212,8 +179,6 @@ jobs:
212179
pydpf-post:
213180
name: "PyDPF-Post"
214181
if: |
215-
github.event.action != 'closed' &&
216-
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
217182
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
218183
uses: ./.github/workflows/pydpf-post.yml
219184
needs: pick_server_suffix
@@ -227,8 +192,6 @@ jobs:
227192
tests-retro:
228193
name: "Test DPF ${{ matrix.version }} compatibility"
229194
if: |
230-
github.event.action != 'closed' &&
231-
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
232195
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
233196
strategy:
234197
fail-fast: false
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: doc-deploy-PR
2+
3+
on:
4+
workflow_run:
5+
workflows: [ci]
6+
types: [completed]
7+
pull_request:
8+
types: [closed]
9+
10+
env:
11+
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
12+
13+
jobs:
14+
debug:
15+
name: debug
16+
runs-on: ubuntu-latest
17+
env:
18+
EVENT_OBJ: ${{ toJson(github.event) }}
19+
steps:
20+
- run: echo $EVENT_OBJ
21+
doc-deploy-pr:
22+
name: "Deploy PR documentation"
23+
runs-on: ubuntu-latest
24+
if: |
25+
(
26+
github.event_name == 'workflow_run' &&
27+
github.event.workflow_run.conclusion == 'success' &&
28+
contains(github.event.workflow_run.pull_requests.*.labels.*.name, 'deploy-pr-doc')
29+
) || (
30+
github.event_name == 'pull_request' &&
31+
github.event.action == 'closed' &&
32+
contains(github.event.pull_request.labels.*.name, 'deploy-pr-doc')
33+
)
34+
steps:
35+
- name: Set PR number
36+
id: pr
37+
run: |
38+
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
39+
echo "pr_number=${{ fromJson(toJson(github.event.workflow_run.pull_requests[0])).number }}" >> "$GITHUB_OUTPUT"
40+
else
41+
echo "pr_number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
42+
fi
43+
44+
- name: Print PR number
45+
run: echo "PR number is ${{ steps.pr.outputs.pr_number }}"
46+
47+
- name: Download artifacts (if workflow_run)
48+
if: ${{ github.event_name == 'workflow_run' }}
49+
uses: dawidd6/action-download-artifact@v11
50+
with:
51+
workflow: docs.yml
52+
name: HTML-doc-ansys-dpf-core.zip
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
run_id: ${{ github.event.workflow_run.id }}
55+
56+
- name: Display downloaded files (if workflow_run)
57+
if: ${{ github.event_name == 'workflow_run' }}
58+
run: ls -R
59+
60+
- name: Deploy PR documentation
61+
uses: ansys/actions/doc-deploy-pr@v10
62+
with:
63+
cname: ${{ env.DOCUMENTATION_CNAME }}
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
66+
decompress-artifact: true
67+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
68+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
69+
maximum-pr-doc-deployments: 10

.github/workflows/pydpf-post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
echo branch="$BranchName"
123123
if [ "$BranchName" = '' ];
124124
then
125-
BranchName=$(git ls-remote --tags --refs $REPO | tail -n1 | cut -d/ -f3)
125+
BranchName=$(git ls-remote --tags --sort="v:refname" --refs $REPO | tail -n1 | cut -d/ -f3)
126126
fi
127127
echo branch=$BranchName
128128
git clone --single-branch --branch "$BranchName" $REPO

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* [Jose Armando Henriquez Roa](https://github.com/jose-henriquez-roa)
3636
* [jose-henriquezroa](https://github.com/jose-henriquezroa)
3737
* [Joshua Fairchild](https://github.com/joshuafairch)
38+
* [Josip Vidal Orlovac](https://github.com/jvidalor)
3839
* [jviqueg](https://github.com/jviqueg)
3940
* [Kathy Pippert](https://github.com/PipKat)
4041
* [kmahajan-cadfem](https://github.com/kmahajan-cadfem)

SECURITY.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Reporting a vulnerability
2+
3+
> [!CAUTION]
4+
> Do not use GitHub issues to report any security vulnerabilities.
5+
6+
If you detect a vulnerability, contact the [PyAnsys Core team](mailto:[email protected]),
7+
mentioning the repository and the details of your finding. The team will address it as soon as possible.
8+
9+
Provide the PyAnsys Core team with this information:
10+
11+
- Any specific configuration settings needed to reproduce the problem
12+
- Step-by-step guidance to reproduce the problem
13+
- The exact location of the problematic source code, including tag, branch, commit, or a direct URL
14+
- The potential consequences of the vulnerability, along with a description of how an attacker could take advantage of the issue

0 commit comments

Comments
 (0)