Skip to content

Commit

Permalink
Merge branch 'main' into feat/named-selections-plot
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroFernandezLuces authored Nov 22, 2023
2 parents 017adfa + f3c32e8 commit 4d9f56f
Show file tree
Hide file tree
Showing 87 changed files with 2,886 additions and 801 deletions.
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@
- name: testing
description: Anything related to tests
color: BFE4D6

- name: security
description: Anything related to security advisories
color: FF0000
95 changes: 84 additions & 11 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
- main

env:
MAIN_PYTHON_VERSION: '3.10'
MAIN_PYTHON_VERSION: '3.11'
MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED: '3.9'
PACKAGE_NAME: 'ansys-geometry-core'
DOCUMENTATION_CNAME: 'geometry.docs.pyansys.com'
ANSRV_GEO_IMAGE: 'ghcr.io/ansys/geometry'
Expand All @@ -20,6 +21,9 @@ env:
RESET_IMAGE_CACHE: 6
IS_WORKFLOW_RUNNING: True
ARTIFACTORY_VERSION: v241
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
MEILISEARCH_HOST_URL: ${{ vars.MEILISEARCH_HOST_URL }}
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -34,7 +38,7 @@ jobs:
- name: PyAnsys documentation style checks
uses: ansys/actions/doc-style@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

smoke-tests:
name: Build and Smoke tests
Expand All @@ -43,7 +47,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
should-release:
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
exclude:
Expand Down Expand Up @@ -85,7 +89,7 @@ jobs:
if: env.SKIP_UNSTABLE == 'false'
uses: actions/setup-python@v4
with:
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }} # self-hosted has an issue with 3.11

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

- name: Set up headless display
uses: pyvista/setup-headless-display-action@v2
Expand Down Expand Up @@ -254,6 +258,12 @@ jobs:
cd doc
.\make.bat pdf
- name: Add assets to HTML docs
run: |
zip -r documentation-html.zip .\doc\_build\html
mv documentation-html.zip .\doc\_build\html\_static\assets\download\
cp doc/_build/latex/ansys-geometry-core.pdf .\doc\_build\html\_static\assets\download\
- name: Upload HTML documentation
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -338,7 +348,6 @@ jobs:
ALLOW_PLOTTING: true
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
pytest-extra-args: "--service-os=linux"
checkout: false

- name: Upload integration test logs
Expand Down Expand Up @@ -391,6 +400,12 @@ jobs:
labels: [self-hosted, Windows, signtool]

steps:
- name: Check out repository pyansys-geometry-binaries
uses: actions/checkout@v4
with:
repository: 'ansys/pyansys-geometry-binaries'
token: ${{ secrets.BINARIES_TOKEN }}

- name: Download binaries
run: |
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/${{ env.ARTIFACTORY_VERSION }}/DockerWindows.zip --output windows-binaries.zip
Expand All @@ -401,14 +416,28 @@ jobs:
with:
name: windows-binaries.zip
path: windows-binaries.zip
retention-days: 7
retention-days: 1

- name: Upload Linux binaries as workflow artifacts
uses: actions/upload-artifact@v3
with:
name: linux-binaries.zip
path: linux-binaries.zip
retention-days: 7
retention-days: 1

- name: Publish the binaries to private repo
env:
VERSION_WITH_PREFIX: ${{ github.ref_name }}
run: |
$env:VERSION=$env:VERSION_WITH_PREFIX.substring(1)
mkdir $env:VERSION
mv windows-binaries.zip .\$env:VERSION\
mv linux-binaries.zip .\$env:VERSION\
git config user.email ${{ secrets.BINARIES_EMAIL }}
git config user.name ${{ secrets.BINARIES_USERNAME }}
git add *
git commit -m "adding binaries for ${{ github.ref_name }}"
git push origin main
build-windows-container:
name: Building Geometry Service - Windows
Expand All @@ -421,7 +450,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }} # self-hosted has an issue with 3.11

- name: Download Windows binaries
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -549,7 +578,7 @@ jobs:
ALLOW_PLOTTING: true
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
pytest-extra-args: "--service-os=linux --use-existing-service=yes"
pytest-extra-args: "--use-existing-service=yes"
checkout: false
requires-xvfb: true

Expand Down Expand Up @@ -590,7 +619,7 @@ jobs:
uses: ansys/actions/release-github@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
additional-artifacts: windows-binaries.zip windows-dockerfile.zip linux-binaries.zip linux-dockerfile.zip
additional-artifacts: windows-dockerfile.zip linux-dockerfile.zip

upload_dev_docs:
name: Upload dev documentation
Expand All @@ -604,6 +633,21 @@ jobs:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

doc-index-dev:
name: "Deploy dev index docs"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: upload_dev_docs
steps:
- name: "Deploy the latest documentation index"
uses: ansys/actions/doc-deploy-index@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
index-name: pyansys-geometry-vdev
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}

upload_docs_release:
name: Upload release documentation
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
Expand All @@ -615,3 +659,32 @@ jobs:
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

doc-index-stable:
name: "Deploy stable docs index"
runs-on: ubuntu-latest
needs: upload_docs_release
steps:
- name: "Install Git and clone project"
uses: actions/checkout@v4

- name: "Install the package requirements"
run: pip install -e .

- name: "Get the version to PyMeilisearch"
run: |
VERSION=$(python -c "from ansys.geometry.core import __version__; print('.'.join(__version__.split('.')[:2]))")
VERSION_MEILI=$(python -c "from ansys.geometry.core import __version__; print('-'.join(__version__.split('.')[:2]))")
echo "Calculated VERSION: $VERSION"
echo "Calculated VERSION_MEILI: $VERSION_MEILI"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV
- name: "Deploy the latest documentation index"
uses: ansys/actions/doc-deploy-index@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}
index-name: pyansys-geometry-v${{ env.VERSION_MEILI }}
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
46 changes: 46 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '45 22 * * 4'

jobs:
analyze:
name: Analyze
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: 'python'
config: |
paths:
- src
# 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

- name: Autobuild
uses: github/codeql-action/autobuild@v2

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:python"
2 changes: 1 addition & 1 deletion .github/workflows/docker_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
with:
package-name: 'geometry'
token: ${{ secrets.GITHUB_TOKEN }}
tags-kept: 'windows-latest, windows-latest-unstable, linux-latest, linux-latest-unstable'
tags-kept: 'windows-latest, windows-latest-unstable, linux-latest, linux-latest-unstable, 24.1, 24.2'
Loading

0 comments on commit 4d9f56f

Please sign in to comment.