Skip to content

Commit bdd943d

Browse files
authored
Resolve ci issues identified by ansys-automation. (#92)
1 parent 99c4256 commit bdd943d

File tree

4 files changed

+92
-24
lines changed

4 files changed

+92
-24
lines changed

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,30 @@ updates:
77
labels:
88
- "maintenance"
99
- "dependencies"
10+
commit-message:
11+
prefix: "build"
12+
cooldown:
13+
default-days: 10
14+
include:
15+
- "*" # Include all dependencies in cooldown
16+
exclude:
17+
- "ansys/actions"
1018

1119
- package-ecosystem: "github-actions"
1220
directory: "/"
1321
schedule:
1422
interval: "weekly"
23+
labels:
24+
- "maintenance"
25+
commit-message:
26+
prefix: "ci"
27+
cooldown:
28+
default-days: 10
29+
include:
30+
- "*" # Include all dependencies in cooldown
31+
exclude:
32+
- "ansys/actions"
33+
groups:
34+
actions:
35+
patterns:
36+
- "*"

.github/workflows/cicd.yml

Lines changed: 64 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,48 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
env:
1418
DOCUMENTATION_CNAME: 'engineeringworkflow.docs.pyansys.com'
1519
MAIN_PYTHON_VERSION: '3.13'
1620
PACKAGE_NAME: 'ansys-engineeringworkflow-api'
1721
PACKAGE_NAMESPACE: 'ansys.engineeringworkflow.api'
1822

23+
permissions: {} # Zero permissions can be granted at the workflow level if not all jobs require permissions.
24+
# As a good rule of thumb, this normally includes jobs that don't use secrets.
25+
1926
jobs:
27+
check-vulnerabilities:
28+
name: "Check library vulnerabilities"
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: ansys/actions/check-vulnerabilities@eb7d0fc873deeee6d4740774675ce1741cb6f154 # v10.2.2
32+
with:
33+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
34+
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
35+
python-package-name: ${{ env.PACKAGE_NAME }}
36+
dev-mode: ${{ github.ref != 'refs/heads/main' }}
37+
38+
actions-security:
39+
name: "Check actions security"
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: ansys/actions/check-actions-security@eb7d0fc873deeee6d4740774675ce1741cb6f154 # v10.2.2
43+
with:
44+
generate-summary: true
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
auditing-level: 'high'
47+
trust-ansys-actions: false
48+
2049
code-style:
2150
name: "Code style"
2251
runs-on: ubuntu-latest
2352
steps:
2453
- name: PyAnsys code style checks
25-
uses: ansys/actions/code-style@v8
54+
uses: ansys/actions/code-style@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
2655
with:
2756
python-version: ${{ env.MAIN_PYTHON_VERSION }}
2857

@@ -31,7 +60,7 @@ jobs:
3160
runs-on: ubuntu-latest
3261
steps:
3362
- name: PyAnsys documentation style checks
34-
uses: ansys/actions/doc-style@v8
63+
uses: ansys/actions/doc-style@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
3564
with:
3665
token: ${{ secrets.GITHUB_TOKEN }}
3766

@@ -52,7 +81,7 @@ jobs:
5281

5382
steps:
5483
- name: Build wheelhouse and perform smoke test
55-
uses: ansys/actions/build-wheelhouse@v8
84+
uses: ansys/actions/build-wheelhouse@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
5685
with:
5786
library-name: ${{ env.PACKAGE_NAME }}
5887
operating-system: ${{ matrix.os }}
@@ -64,18 +93,18 @@ jobs:
6493
needs: [smoke-tests]
6594
steps:
6695
- name: Run pytest
67-
uses: ansys/actions/tests-pytest@v8
96+
uses: ansys/actions/tests-pytest@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
6897
with:
6998
python-version: ${{ matrix.python-version }}
7099
pytest-extra-args: -v --durations=10 --maxfail=10 --cov=${{ env.PACKAGE_NAMESPACE }} --cov-report=xml:coverage.xml --cov-report=html --cov-report term
71100

72101
- name: "Upload coverage to Codecov"
73-
uses: codecov/codecov-action@v5
102+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
74103
with:
75104
files: coverage.xml
76105

77106
- name: "Upload coverage artifacts"
78-
uses: actions/upload-artifact@v4
107+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
79108
with:
80109
name: coverage-html
81110
path: htmlcov
@@ -96,7 +125,7 @@ jobs:
96125
runs-on: ubuntu-latest
97126
steps:
98127
- name: Build library source and wheel artifacts
99-
uses: ansys/actions/build-library@v8
128+
uses: ansys/actions/build-library@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
100129
with:
101130
library-name: ${{ env.PACKAGE_NAME }}
102131
python-version: ${{ env.MAIN_PYTHON_VERSION }}
@@ -109,39 +138,53 @@ jobs:
109138
needs: [package]
110139
steps:
111140
- name: "Deploy the latest documentation"
112-
uses: ansys/actions/doc-deploy-dev@v8
141+
uses: ansys/actions/doc-deploy-dev@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
113142
with:
114143
cname: ${{ env.DOCUMENTATION_CNAME }}
115144
token: ${{ secrets.GITHUB_TOKEN }}
116145

117146
release:
118147
name: "Release project to public PyPI and GitHub"
119-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
120-
needs: [package]
148+
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
149+
needs: [package]
121150
runs-on: ubuntu-latest
151+
# INFO: Specifying a GitHub environment is optional but encouraged
152+
environment: release
153+
# INFO: Trusted publishers require these permissions
154+
permissions:
155+
id-token: write # required by trusted publishers
156+
contents: write # required by trusted publishers
122157
steps:
158+
- name: Download the library artifacts from build-library step
159+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
160+
with:
161+
name: ${{ env.PACKAGE_NAME }}-artifacts
162+
path: ${{ env.PACKAGE_NAME }}-artifacts
123163

124-
- name: "Release to the public PyPI repository"
125-
uses: ansys/actions/release-pypi-public@v8
126-
with:
127-
library-name: ${{ env.PACKAGE_NAME }}
128-
twine-username: "__token__"
129-
twine-token: ${{ secrets.PYPI_TOKEN }}
164+
- name: Release to PyPI using trusted publisher
165+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
166+
with:
167+
repository-url: "https://upload.pypi.org/legacy/"
168+
print-hash: true
169+
packages-dir: ${{ env.PACKAGE_NAME }}-artifacts
170+
skip-existing: false
130171

131-
- name: "Release to GitHub"
132-
uses: ansys/actions/release-github@v8
133-
with:
134-
library-name: ${{ env.PACKAGE_NAME }}
172+
- name: "Release to GitHub"
173+
uses: ansys/actions/release-github@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
174+
with:
175+
library-name: ${{ env.PACKAGE_NAME }}
135176

136177
doc-deploy-stable:
137178
name: "Deploy stable documentation"
138179
# Deploy release documentation when creating a new tag
139180
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
140181
runs-on: ubuntu-latest
141182
needs: [release]
183+
permissions:
184+
contents: write # Write permissions to deploy the documentation
142185
steps:
143186
- name: "Deploy the stable documentation"
144-
uses: ansys/actions/doc-deploy-stable@v8
187+
uses: ansys/actions/doc-deploy-stable@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
145188
with:
146189
cname: ${{ env.DOCUMENTATION_CNAME }}
147190
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ test-output.xml
7272
.\#*
7373
/.ipynb_checkpoints
7474

75+
# Files part of the ansys/check_vulnerabilities script
76+
check_vulnerabilities.py
77+
info_bandit.json
78+
info_safety.json
79+
requirements.txt

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ classifiers = [
2323
]
2424

2525
dependencies = [
26-
"anyio>=3.6",
26+
"anyio>=4.4",
2727
"numpy>=2.1.0",
2828
"pyansys-tools-variableinterop>=0.1.0",
2929
]
3030

3131
[project.optional-dependencies]
3232
doc = [
3333
"ansys-sphinx-theme[autoapi]==1.6.3",
34-
"anyio==4.3.0",
3534
"numpydoc==1.10.0",
3635
"pyansys-tools-variableinterop==0.1.1",
3736
"Sphinx==8.2.3",
@@ -42,7 +41,6 @@ doc = [
4241
]
4342

4443
tests = [
45-
"anyio==4.3.0",
4644
"pytest==8.1.1",
4745
"pytest-cov==7.0.0",
4846
"pyansys-tools-variableinterop==0.1.1",

0 commit comments

Comments
 (0)