Skip to content

Commit 65f860a

Browse files
committed
Resolve ci issues identified by ansys-automation.
1 parent 99c4256 commit 65f860a

File tree

4 files changed

+88
-24
lines changed

4 files changed

+88
-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: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,38 @@ env:
1616
PACKAGE_NAME: 'ansys-engineeringworkflow-api'
1717
PACKAGE_NAMESPACE: 'ansys.engineeringworkflow.api'
1818

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

@@ -31,7 +56,7 @@ jobs:
3156
runs-on: ubuntu-latest
3257
steps:
3358
- name: PyAnsys documentation style checks
34-
uses: ansys/actions/doc-style@v8
59+
uses: ansys/actions/doc-style@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
3560
with:
3661
token: ${{ secrets.GITHUB_TOKEN }}
3762

@@ -52,7 +77,7 @@ jobs:
5277

5378
steps:
5479
- name: Build wheelhouse and perform smoke test
55-
uses: ansys/actions/build-wheelhouse@v8
80+
uses: ansys/actions/build-wheelhouse@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
5681
with:
5782
library-name: ${{ env.PACKAGE_NAME }}
5883
operating-system: ${{ matrix.os }}
@@ -64,18 +89,18 @@ jobs:
6489
needs: [smoke-tests]
6590
steps:
6691
- name: Run pytest
67-
uses: ansys/actions/tests-pytest@v8
92+
uses: ansys/actions/tests-pytest@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
6893
with:
6994
python-version: ${{ matrix.python-version }}
7095
pytest-extra-args: -v --durations=10 --maxfail=10 --cov=${{ env.PACKAGE_NAMESPACE }} --cov-report=xml:coverage.xml --cov-report=html --cov-report term
7196

7297
- name: "Upload coverage to Codecov"
73-
uses: codecov/codecov-action@v5
98+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7499
with:
75100
files: coverage.xml
76101

77102
- name: "Upload coverage artifacts"
78-
uses: actions/upload-artifact@v4
103+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
79104
with:
80105
name: coverage-html
81106
path: htmlcov
@@ -96,7 +121,7 @@ jobs:
96121
runs-on: ubuntu-latest
97122
steps:
98123
- name: Build library source and wheel artifacts
99-
uses: ansys/actions/build-library@v8
124+
uses: ansys/actions/build-library@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
100125
with:
101126
library-name: ${{ env.PACKAGE_NAME }}
102127
python-version: ${{ env.MAIN_PYTHON_VERSION }}
@@ -109,39 +134,53 @@ jobs:
109134
needs: [package]
110135
steps:
111136
- name: "Deploy the latest documentation"
112-
uses: ansys/actions/doc-deploy-dev@v8
137+
uses: ansys/actions/doc-deploy-dev@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
113138
with:
114139
cname: ${{ env.DOCUMENTATION_CNAME }}
115140
token: ${{ secrets.GITHUB_TOKEN }}
116141

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

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 }}
160+
- name: Release to PyPI using trusted publisher
161+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
162+
with:
163+
repository-url: "https://upload.pypi.org/legacy/"
164+
print-hash: true
165+
packages-dir: ${{ env.PACKAGE_NAME }}-artifacts
166+
skip-existing: false
130167

131-
- name: "Release to GitHub"
132-
uses: ansys/actions/release-github@v8
133-
with:
134-
library-name: ${{ env.PACKAGE_NAME }}
168+
- name: "Release to GitHub"
169+
uses: ansys/actions/release-github@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
170+
with:
171+
library-name: ${{ env.PACKAGE_NAME }}
135172

136173
doc-deploy-stable:
137174
name: "Deploy stable documentation"
138175
# Deploy release documentation when creating a new tag
139176
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
140177
runs-on: ubuntu-latest
141178
needs: [release]
179+
permissions:
180+
contents: write # Write permissions to deploy the documentation
142181
steps:
143182
- name: "Deploy the stable documentation"
144-
uses: ansys/actions/doc-deploy-stable@v8
183+
uses: ansys/actions/doc-deploy-stable@010ddbe522e0a9aed3cbd850b4e226dcfae4ecda # v8.2.30
145184
with:
146185
cname: ${{ env.DOCUMENTATION_CNAME }}
147186
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)