Skip to content

Commit 1a79f82

Browse files
committed
Merge branch 'main' into release/0.4
2 parents 58a9398 + 114d4e8 commit 1a79f82

Some content is hidden

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

45 files changed

+663
-368
lines changed

.github/labels.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@
3737
- name: testing
3838
description: Anything related to tests
3939
color: BFE4D6
40+
41+
- name: security
42+
description: Anything related to security advisories
43+
color: FF0000

.github/workflows/ci_cd.yml

Lines changed: 83 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
- main
1010

1111
env:
12-
MAIN_PYTHON_VERSION: '3.10'
12+
MAIN_PYTHON_VERSION: '3.11'
13+
MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED: '3.9'
1314
PACKAGE_NAME: 'ansys-geometry-core'
1415
DOCUMENTATION_CNAME: 'geometry.docs.pyansys.com'
1516
ANSRV_GEO_IMAGE: 'ghcr.io/ansys/geometry'
@@ -20,6 +21,9 @@ env:
2021
RESET_IMAGE_CACHE: 6
2122
IS_WORKFLOW_RUNNING: True
2223
ARTIFACTORY_VERSION: v241
24+
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
25+
MEILISEARCH_HOST_URL: ${{ vars.MEILISEARCH_HOST_URL }}
26+
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
2327

2428
concurrency:
2529
group: ${{ github.workflow }}-${{ github.ref }}
@@ -43,7 +47,7 @@ jobs:
4347
fail-fast: false
4448
matrix:
4549
os: [ubuntu-latest, windows-latest, macos-latest]
46-
python-version: ['3.8', '3.9', '3.10', '3.11']
50+
python-version: ['3.9', '3.10', '3.11']
4751
should-release:
4852
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
4953
exclude:
@@ -85,7 +89,7 @@ jobs:
8589
if: env.SKIP_UNSTABLE == 'false'
8690
uses: actions/setup-python@v4
8791
with:
88-
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
92+
python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }} # self-hosted has an issue with 3.11
8993

9094
- name: Set up headless display
9195
if: env.SKIP_UNSTABLE == 'false'
@@ -204,7 +208,7 @@ jobs:
204208
- name: Set up Python
205209
uses: actions/setup-python@v4
206210
with:
207-
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
211+
python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }} # self-hosted has an issue with 3.11
208212

209213
- name: Set up headless display
210214
uses: pyvista/setup-headless-display-action@v2
@@ -254,6 +258,12 @@ jobs:
254258
cd doc
255259
.\make.bat pdf
256260
261+
- name: Add assets to HTML docs
262+
run: |
263+
zip -r documentation-html.zip .\doc\_build\html
264+
mv documentation-html.zip .\doc\_build\html\_static\assets\download\
265+
cp doc/_build/latex/ansys-geometry-core.pdf .\doc\_build\html\_static\assets\download\
266+
257267
- name: Upload HTML documentation
258268
uses: actions/upload-artifact@v3
259269
with:
@@ -338,7 +348,6 @@ jobs:
338348
ALLOW_PLOTTING: true
339349
with:
340350
python-version: ${{ env.MAIN_PYTHON_VERSION }}
341-
pytest-extra-args: "--service-os=linux"
342351
checkout: false
343352

344353
- name: Upload integration test logs
@@ -391,6 +400,12 @@ jobs:
391400
labels: [self-hosted, Windows, signtool]
392401

393402
steps:
403+
- name: Check out repository pyansys-geometry-binaries
404+
uses: actions/checkout@v4
405+
with:
406+
repository: 'ansys/pyansys-geometry-binaries'
407+
token: ${{ env.BINARIES_TOKEN }}
408+
394409
- name: Download binaries
395410
run: |
396411
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/${{ env.ARTIFACTORY_VERSION }}/DockerWindows.zip --output windows-binaries.zip
@@ -401,14 +416,28 @@ jobs:
401416
with:
402417
name: windows-binaries.zip
403418
path: windows-binaries.zip
404-
retention-days: 7
419+
retention-days: 1
405420

406421
- name: Upload Linux binaries as workflow artifacts
407422
uses: actions/upload-artifact@v3
408423
with:
409424
name: linux-binaries.zip
410425
path: linux-binaries.zip
411-
retention-days: 7
426+
retention-days: 1
427+
428+
- name: Publish the binaries to private repo
429+
env:
430+
VERSION_WITH_PREFIX: ${{ github.ref_name }}
431+
run: |
432+
$env:VERSION=$env:VERSION_WITH_PREFIX.substring(1)
433+
mkdir $env:VERSION
434+
mv windows-binaries.zip .\$env:VERSION\
435+
mv linux-binaries.zip .\$env:VERSION\
436+
git config user.email ${{ env.BINARIES_EMAIL }}
437+
git config user.name ${{ env.BINARIES_USERNAME }}
438+
git add *
439+
git commit -m "adding binaries for ${{ github.ref_name }}"
440+
git push origin main
412441
413442
build-windows-container:
414443
name: Building Geometry Service - Windows
@@ -421,7 +450,7 @@ jobs:
421450
- name: Set up Python
422451
uses: actions/setup-python@v4
423452
with:
424-
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
453+
python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }} # self-hosted has an issue with 3.11
425454

426455
- name: Download Windows binaries
427456
uses: actions/download-artifact@v3
@@ -549,7 +578,7 @@ jobs:
549578
ALLOW_PLOTTING: true
550579
with:
551580
python-version: ${{ env.MAIN_PYTHON_VERSION }}
552-
pytest-extra-args: "--service-os=linux --use-existing-service=yes"
581+
pytest-extra-args: "--use-existing-service=yes"
553582
checkout: false
554583
requires-xvfb: true
555584

@@ -590,7 +619,7 @@ jobs:
590619
uses: ansys/actions/release-github@v4
591620
with:
592621
library-name: ${{ env.PACKAGE_NAME }}
593-
additional-artifacts: windows-binaries.zip windows-dockerfile.zip linux-binaries.zip linux-dockerfile.zip
622+
additional-artifacts: windows-dockerfile.zip linux-dockerfile.zip
594623

595624
upload_dev_docs:
596625
name: Upload dev documentation
@@ -604,6 +633,21 @@ jobs:
604633
cname: ${{ env.DOCUMENTATION_CNAME }}
605634
token: ${{ secrets.GITHUB_TOKEN }}
606635

636+
doc-index-dev:
637+
name: "Deploy dev index docs"
638+
if: github.ref == 'refs/heads/main'
639+
runs-on: ubuntu-latest
640+
needs: upload_dev_docs
641+
steps:
642+
- name: "Deploy the latest documentation index"
643+
uses: ansys/actions/doc-deploy-index@v4
644+
with:
645+
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
646+
index-name: pyansys-geometry-vdev
647+
host-url: ${{ env.MEILISEARCH_HOST_URL }}
648+
api-key: ${{ env.MEILISEARCH_API_KEY }}
649+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
650+
607651
upload_docs_release:
608652
name: Upload release documentation
609653
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
@@ -615,3 +659,32 @@ jobs:
615659
with:
616660
cname: ${{ env.DOCUMENTATION_CNAME }}
617661
token: ${{ secrets.GITHUB_TOKEN }}
662+
663+
doc-index-stable:
664+
name: "Deploy stable docs index"
665+
runs-on: ubuntu-latest
666+
needs: upload_docs_release
667+
steps:
668+
- name: "Install Git and clone project"
669+
uses: actions/checkout@v4
670+
671+
- name: "Install the package requirements"
672+
run: pip install -e .
673+
674+
- name: "Get the version to PyMeilisearch"
675+
run: |
676+
VERSION=$(python -c "from ansys.geometry.core import __version__; print('.'.join(__version__.split('.')[:2]))")
677+
VERSION_MEILI=$(python -c "from ansys.geometry.core import __version__; print('-'.join(__version__.split('.')[:2]))")
678+
echo "Calculated VERSION: $VERSION"
679+
echo "Calculated VERSION_MEILI: $VERSION_MEILI"
680+
echo "VERSION=$VERSION" >> $GITHUB_ENV
681+
echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV
682+
683+
- name: "Deploy the latest documentation index"
684+
uses: ansys/actions/doc-deploy-index@v4
685+
with:
686+
cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}
687+
index-name: pyansys-geometry-v${{ env.VERSION_MEILI }}
688+
host-url: ${{ env.MEILISEARCH_HOST_URL }}
689+
api-key: ${{ env.MEILISEARCH_API_KEY }}
690+
python-version: ${{ env.MAIN_PYTHON_VERSION }}

.github/workflows/codeql.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '45 22 * * 4'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: 'ubuntu-latest'
15+
timeout-minutes: 360
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Initialize CodeQL
25+
uses: github/codeql-action/init@v2
26+
with:
27+
languages: 'python'
28+
config: |
29+
paths:
30+
- src
31+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
32+
33+
- name: Autobuild
34+
uses: github/codeql-action/autobuild@v2
35+
36+
# If the Autobuild fails above, remove it and uncomment the following three lines.
37+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
38+
39+
# - run: |
40+
# echo "Run, Build Application using script"
41+
# ./location_of_script_within_repo/buildscript.sh
42+
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@v2
45+
with:
46+
category: "/language:python"

0 commit comments

Comments
 (0)