From d4fa0e88dd5209eb742b556719824a7f1d005147 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Thu, 25 Sep 2025 16:32:51 -0400 Subject: [PATCH 01/17] run actions/setup-python if it's a dev container --- .github/workflows/ci_cd.yml | 147 +++++++++++----------- .github/workflows/setup-python/action.yml | 18 ++- 2 files changed, 86 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 746d2b896..dbbc48f3b 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -4,16 +4,18 @@ on: pull_request: workflow_dispatch: inputs: - revn: + mechanical-image: type: choice options: - - '261' - - '252' - - '251' - - '242' - - '241' - description: 'The Mechanical revision number to run tests on.' - default: '252' #stable version is 252, must match $stable_container + - '26.1_Dev' + - '26.1_candidate' + - '26.1.0' + - '25.2.0' + - '25.1.0' + - '24.2.0' + - '24.1.0' + description: 'The Mechanical image to run tests on.' + default: '25.1.0' #stable version is 252, must match $stable_container schedule: - cron: '00 22 * * *' # UTC time, may start 5-15 mins later than scheduled time push: @@ -31,9 +33,8 @@ env: PACKAGE_NAME: ansys-mechanical-core DOCUMENTATION_CNAME: mechanical.docs.pyansys.com MAIN_PYTHON_VERSION: '3.12' - # DEV_REVN & its Docker image are used in scheduled or registry package runs - STABLE_REVN: '252' - DEV_REVN: '261' + STABLE_CONTAINER: '25.2.0' + CANDIDATE_CONTAINER: '26.1_candidate' LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }} ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }} @@ -42,6 +43,38 @@ concurrency: cancel-in-progress: true jobs: + run-type-container: + name: Set test container + runs-on: ubuntu-latest + outputs: + test_container: ${{ steps.container.outputs.test }} + is_dev_container: ${{ steps.container.outputs.is_dev_container }} + steps: + - id: container + run: | + # Default to not a dev container (container does not contain "Dev" in its name) + is_dev_container=false + + # If it's a scheduled (nightly) run, use the candidate container (26.1_candidate) + if ${{ github.event_name == 'schedule' }}; then + test=${{ env.DOCKER_PACKAGE }}:${{ env.CANDIDATE_CONTAINER }} + else + # If a specific mechanical-image is not provided, use the stable container (25.2.0) + if [[ -z "${{ inputs.mechanical-image }}" ]]; then + test=${{ env.DOCKER_PACKAGE }}:${{ env.STABLE_CONTAINER }}" + else + test=${{ env.DOCKER_PACKAGE }}:${{ inputs.mechanical-image }} + + # If the provided mechanical-image contains "Dev", set is_dev_container to true + if [[ "${{ inputs.mechanical-image }}" == *"Dev"* ]]; then + is_dev_container=true + fi + + fi + fi + + echo "test=$test" >> $GITHUB_OUTPUT + update-changelog: name: "Update CHANGELOG for new tag" if: github.event_name == 'push' && contains(github.ref, 'refs/tags') @@ -117,55 +150,15 @@ jobs: operating-system: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - revn-variations: - name: Save variations of revn - runs-on: ubuntu-latest - outputs: - stable_container: ${{ steps.save-versions.outputs.stable_container }} - test_revn: '${{ steps.save-versions.outputs.test_revn }}' - test_container: ${{ steps.save-versions.outputs.test_container }} - test_docker_image_version: '${{ steps.save-versions.outputs.test_docker_image_version }}' - steps: - - id: save-versions - run: | - if ${{ github.event_name == 'schedule' }}; then - echo "test_revn=${{ env.DEV_REVN}}" >> $GITHUB_OUTPUT - test_mech_revn=${{ env.DEV_REVN}} - test_mech_image_version=${test_mech_revn:0:2}.${test_mech_revn:2}_candidate - echo "test_container=${{ env.DOCKER_PACKAGE }}:$test_mech_image_version" >> $GITHUB_OUTPUT - echo "test_docker_image_version=$test_mech_image_version" >> $GITHUB_OUTPUT - else - if [[ -z "${{inputs.revn}}" ]]; then - mech_revn=${{ env.STABLE_REVN }} - else - mech_revn=${{inputs.revn}} - fi - export mech_image_version=${mech_revn:0:2}.${mech_revn:2}.0 - echo "test_revn=$mech_revn" >> $GITHUB_OUTPUT - echo "test_container=${{ env.DOCKER_PACKAGE }}:$mech_image_version" >> $GITHUB_OUTPUT - echo "test_docker_image_version=$mech_image_version" >> $GITHUB_OUTPUT - fi - - stable_mech_revn=${{ env.STABLE_REVN }} - stable_mech_image_version=${mech_revn:0:2}.${mech_revn:2}.0 - echo "stable_container=${{ env.DOCKER_PACKAGE }}:$stable_mech_image_version" >> $GITHUB_OUTPUT - - echo $GITHUB_OUTPUT - - # --- Help ---- - # schedule nightly uses DEV_REVN candidate - # PRs and merges use STABLE_REVN - # Workflow dispatch can use any revision number - test-container-info: name: Get SHA of test container runs-on: public-ubuntu-latest-8-cores - needs: [revn-variations] + needs: [run-type-container] outputs: sha: ${{ steps.get_sha.outputs.sha }} strategy: matrix: - test_container: ['${{ needs.revn-variations.outputs.test_container }}'] + test_container: ${{ needs.run-type-container.outputs.test_container }} steps: - name: Login in Github Container registry uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 @@ -195,7 +188,7 @@ jobs: config-matrix: runs-on: ubuntu-latest - needs: [revn-variations] + needs: [run-type-container] outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: @@ -205,12 +198,12 @@ jobs: if ${{ github.event_name == 'push' }} && ${{ contains(github.ref, 'refs/tags') }}; then echo "matrix={\"mechanical-version\":['24.1.0', '24.2.0', '25.1.0', '25.2.0'],\"experimental\":[false]}" >> $GITHUB_OUTPUT else - echo "matrix={\"mechanical-version\":['${{ needs.revn-variations.outputs.test_docker_image_version }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT + echo "matrix={\"mechanical-version\":['${{ needs.run-type-container.outputs.test_container }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT fi container-stability-check: runs-on: ubuntu-latest - needs: [revn-variations] + needs: [run-type-container] outputs: container_stable_exit: ${{ steps.check_stability.outputs.container_stable_exit }} steps: @@ -218,7 +211,7 @@ jobs: run: | sudo apt update sudo apt install bc -y - container_version=$(echo "${{ needs.revn-variations.outputs.test_docker_image_version }}" | grep -o -E '[0-9]+(\.[0-9]+)?' | head -n 1) + container_version=$(echo "${{ needs.run-type-container.outputs.test_container }}" | grep -o -E '[0-9]+(\.[0-9]+)?' | head -n 1) if (( $(echo "$container_version > 24.2" | bc -l) )); then echo "container_stable_exit=true" >> $GITHUB_OUTPUT else @@ -228,7 +221,7 @@ jobs: remote-connect: name: Remote connect testing and coverage - Mechanical ${{ matrix.mechanical-version }} runs-on: public-ubuntu-latest-8-cores - needs: [style, revn-variations, config-matrix] + needs: [style, run-type-container, config-matrix] continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false @@ -254,7 +247,8 @@ jobs: id: capture_info run: | IMAGE_NAME=${{ env.DOCKER_PACKAGE }}:${{ matrix.mechanical-version }} - BUILD_DATE=$(docker run --rm --entrypoint head $IMAGE_NAME -n 1 /install/ansys_inc/v${{ needs.revn-variations.outputs.test_revn }}/aisol/CommonFiles/builddate.txt) + TEST_REVN=$(echo $ANSYS_VERSION) + BUILD_DATE=$(docker run --rm --entrypoint head $IMAGE_NAME -n 1 /install/ansys_inc/v${TEST_REVN}/aisol/CommonFiles/builddate.txt) PUSHED_AT=$(docker inspect --format='{{.Created}}' $IMAGE_NAME) echo "docker_info=$IMAGE_NAME was pushed at: $PUSHED_AT" >> $GITHUB_OUTPUT echo "::group::Docker Info" @@ -283,7 +277,7 @@ jobs: - name: Upload coverage results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: matrix.mechanical-version == needs.revn-variations.outputs.test_docker_image_version + if: matrix.mechanical-version == needs.run-type-container.outputs.test_container with: include-hidden-files: true name: coverage-tests @@ -292,7 +286,7 @@ jobs: - name: Upload coverage results (as .coverage) uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: matrix.mechanical-version == needs.revn-variations.outputs.test_docker_image_version + if: matrix.mechanical-version == needs.run-type-container.outputs.test_container with: include-hidden-files: true name: coverage-file-tests @@ -319,9 +313,9 @@ jobs: name: Embedding testing and coverage runs-on: ubuntu-latest timeout-minutes: 30 - needs: [revn-variations, test-container-info, container-stability-check, smoke-tests] + needs: [run-type-container, test-container-info, container-stability-check, smoke-tests] container: - image: ${{ needs.revn-variations.outputs.test_container }} + image: ${{ needs.run-type-container.outputs.test_container }} options: --entrypoint /bin/bash strategy: fail-fast: false @@ -336,6 +330,7 @@ jobs: with: container-sha: ${{ needs.test-container-info.outputs.sha }} python-version: ${{ matrix.python-version }} + is-dev-container: ${{ needs.run-type-container.outputs.is_dev_container }} - name: "Install packages for testing" run: | @@ -391,9 +386,9 @@ jobs: name: Embedding scripts testing and coverage runs-on: ubuntu-latest timeout-minutes: 30 - needs: [smoke-tests, revn-variations, test-container-info] + needs: [smoke-tests, run-type-container, test-container-info] container: - image: ${{ needs.revn-variations.outputs.test_container }} + image: ${{ needs.run-type-container.outputs.test_container }} options: --entrypoint /bin/bash strategy: fail-fast: false @@ -408,6 +403,7 @@ jobs: with: container-sha: ${{ needs.test-container-info.outputs.sha }} python-version: ${{ matrix.python-version }} + is-dev-container: ${{ needs.run-type-container.outputs.is_dev_container }} - name: "Install packages for testing" run: | @@ -461,9 +457,9 @@ jobs: runs-on: public-ubuntu-latest-8-cores timeout-minutes: 30 container: - image: ${{ needs.revn-variations.outputs.test_container }} + image: ${{ needs.run-type-container.outputs.test_container }} options: --entrypoint /bin/bash - needs: [ style, revn-variations, container-stability-check, test-container-info] + needs: [ style, run-type-container, container-stability-check, test-container-info] strategy: fail-fast: false matrix: @@ -477,6 +473,7 @@ jobs: with: container-sha: ${{ needs.test-container-info.outputs.sha }} python-version: ${{ matrix.python-version }} + is-dev-container: ${{ needs.run-type-container.outputs.is_dev_container }} - name: Install dependencies run: | @@ -490,7 +487,9 @@ jobs: uv pip install -e .[tests] - name: Set environment variable - run: echo "ANSYSCL${{ needs.revn-variations.outputs.test_revn }}_DIR=/install/ansys_inc/v${{ needs.revn-variations.outputs.test_revn }}/licensingclient" >> $GITHUB_ENV + run: | + REVN=$(echo $ANSYS_VERSION) + echo "ANSYSCL${REVN}_DIR=/install/ansys_inc/v${REVN}/licensingclient" >> $GITHUB_ENV - name: Unit Testing and coverage env: @@ -537,10 +536,9 @@ jobs: name: Documentation runs-on: public-ubuntu-latest-8-cores container: - image: ${{ needs.revn-variations.outputs.test_container }} + image: ${{ needs.run-type-container.outputs.test_container }} options: --entrypoint /bin/bash - needs: [style, doc-style, revn-variations, container-stability-check, test-container-info] - + needs: [style, doc-style, run-type-container, container-stability-check, test-container-info] steps: - name: Install Git and checkout project @@ -551,6 +549,7 @@ jobs: with: container-sha: ${{ needs.test-container-info.outputs.sha }} python-version: ${{ env.MAIN_PYTHON_VERSION }} + is-dev-container: ${{ needs.run-type-container.outputs.is_dev_container }} - name: Install system dependencies run: | @@ -664,11 +663,6 @@ jobs: name: coverage-file-tests-embedding path: cov-dir/embedding - # - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 - # with: - # name: coverage-file-tests-embedding-rpc - # path: cov-dir/embedding-rpc - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: coverage-file-tests-embedding-scripts @@ -826,7 +820,6 @@ jobs: notify-on-failure: name: Notify on failure - needs: [revn-variations] if: github.event_name == 'schedule' && failure() runs-on: ubuntu-latest steps: diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index dc45abbc9..6f730b40f 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -19,6 +19,12 @@ inputs: required: true type: string + is-dev-container: + description: > + Whether the container is a dev container (contains "Dev" in its name). + required: true + type: boolean + # Optional inputs python-version-patch: description: > @@ -38,8 +44,15 @@ inputs: runs: using: "composite" steps: + - name: "Set up Python ${{ inputs.python-version }}" + if: ${{ inputs.is-dev-container == true }} + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + with: + python-version: ${{ inputs.python-version }} + cache: "pip" - name: Get most recent Python version + if: ${{ inputs.is-dev-container == false }} shell: bash run: | declare -A python_versions=(["3.10"]="3.10.18" ["3.11"]="3.11.13" ["3.12"]="3.12.11" ["3.13"]="3.13.7") @@ -62,6 +75,7 @@ runs: - name: "Cache Python directories" id: cache-python + if: ${{ inputs.is-dev-container == false }} uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: | @@ -73,14 +87,14 @@ runs: python${{ inputs.python-version }}-dirs - name: "Confirm Python is installed" - if: ${{ steps.cache-python.outputs.cache-hit == 'true' }} + if: ${{ steps.cache-python.outputs.cache-hit == 'true' && inputs.is-dev-container == false }} shell: bash run: | python_location=$(which python${{ inputs.python-version }}) echo "Python ${{ inputs.python-version }} found at $python_location" - name: "Install Python ${{ env.PYTHON_VERSION_PATCH }}" - if: ${{ steps.cache-python.outputs.cache-hit != 'true' }} + if: ${{ steps.cache-python.outputs.cache-hit != 'true' && inputs.is-dev-container == false }} shell: bash run: | # Update package lists From 647df74cf01076f6f8164cff3c8d720a15041f9a Mon Sep 17 00:00:00 2001 From: kmcadams Date: Thu, 25 Sep 2025 16:40:20 -0400 Subject: [PATCH 02/17] fix syntax issue? --- .github/workflows/ci_cd.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index dbbc48f3b..d34bcf624 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -15,7 +15,7 @@ on: - '24.2.0' - '24.1.0' description: 'The Mechanical image to run tests on.' - default: '25.1.0' #stable version is 252, must match $stable_container + default: '25.2.0' #stable version is 25.2.0, must match $stable_container schedule: - cron: '00 22 * * *' # UTC time, may start 5-15 mins later than scheduled time push: @@ -66,10 +66,9 @@ jobs: test=${{ env.DOCKER_PACKAGE }}:${{ inputs.mechanical-image }} # If the provided mechanical-image contains "Dev", set is_dev_container to true - if [[ "${{ inputs.mechanical-image }}" == *"Dev"* ]]; then + if [[ "${{ inputs.mechanical-image }}" =~ "Dev" ]]; then is_dev_container=true fi - fi fi From 79a0fa3d5fdcae2c813cfa22590bd76b01ed5799 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Thu, 25 Sep 2025 16:41:52 -0400 Subject: [PATCH 03/17] remove extra double quote --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index d34bcf624..b39a26a92 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -61,7 +61,7 @@ jobs: else # If a specific mechanical-image is not provided, use the stable container (25.2.0) if [[ -z "${{ inputs.mechanical-image }}" ]]; then - test=${{ env.DOCKER_PACKAGE }}:${{ env.STABLE_CONTAINER }}" + test=${{ env.DOCKER_PACKAGE }}:${{ env.STABLE_CONTAINER }} else test=${{ env.DOCKER_PACKAGE }}:${{ inputs.mechanical-image }} From b3d7bffaddeb909ab2607066c71d83c7a11ae3f2 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Thu, 25 Sep 2025 17:01:06 -0400 Subject: [PATCH 04/17] fix image check --- .github/workflows/ci_cd.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b39a26a92..c1f095cfc 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -195,9 +195,9 @@ jobs: run: | # if a tag(release) is pushed, test all versions if ${{ github.event_name == 'push' }} && ${{ contains(github.ref, 'refs/tags') }}; then - echo "matrix={\"mechanical-version\":['24.1.0', '24.2.0', '25.1.0', '25.2.0'],\"experimental\":[false]}" >> $GITHUB_OUTPUT + echo "matrix={\"mechanical-image\":['${{ env.DOCKER_PACKAGE }}:24.1.0', '${{ env.DOCKER_PACKAGE }}:24.2.0', '${{ env.DOCKER_PACKAGE }}:25.1.0', '${{ env.DOCKER_PACKAGE }}:25.2.0'],\"experimental\":[false]}" >> $GITHUB_OUTPUT else - echo "matrix={\"mechanical-version\":['${{ needs.run-type-container.outputs.test_container }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT + echo "matrix={\"mechanical-image\":['${{ needs.run-type-container.outputs.test_container }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT fi container-stability-check: @@ -234,20 +234,22 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Pull, launch, and validate Mechanical service - env: - MECHANICAL_IMAGE: ${{ env.DOCKER_PACKAGE }}:${{ matrix.mechanical-version }} run: | - docker pull ${{ env.MECHANICAL_IMAGE }} - docker run --restart always --name ${{ env.DOCKER_MECH_CONTAINER_NAME }} -e ANSYSLMD_LICENSE_FILE=1055@${{ env.LICENSE_SERVER }} -p ${{ env.PYMECHANICAL_PORT }}:10000 ${{ env.MECHANICAL_IMAGE }} > log.txt & + docker pull ${{ matrix.mechanical-image }} + docker run --restart always --name ${{ env.DOCKER_MECH_CONTAINER_NAME }} -e ANSYSLMD_LICENSE_FILE=1055@${{ env.LICENSE_SERVER }} -p ${{ env.PYMECHANICAL_PORT }}:10000 ${{ matrix.mechanical-image }} > log.txt & grep -q 'WB Initialize Done' <(timeout 60 tail -f log.txt) - name: Display info if: github.event_name == 'schedule' id: capture_info run: | - IMAGE_NAME=${{ env.DOCKER_PACKAGE }}:${{ matrix.mechanical-version }} - TEST_REVN=$(echo $ANSYS_VERSION) - BUILD_DATE=$(docker run --rm --entrypoint head $IMAGE_NAME -n 1 /install/ansys_inc/v${TEST_REVN}/aisol/CommonFiles/builddate.txt) + IMAGE_NAME=${{ matrix.mechanical-image }} + + IMAGE_NUMS="${IMAGE_NAME#*:}" + IFS='.' read -r year revn rest <<< "$IMAGE_NUMS" + IMAGE_REVN="${year}${revn}" + + BUILD_DATE=$(docker run --rm --entrypoint head $IMAGE_NAME -n 1 /install/ansys_inc/v${IMAGE_REVN}/aisol/CommonFiles/builddate.txt) PUSHED_AT=$(docker inspect --format='{{.Created}}' $IMAGE_NAME) echo "docker_info=$IMAGE_NAME was pushed at: $PUSHED_AT" >> $GITHUB_OUTPUT echo "::group::Docker Info" From 73e6f9fef0761550aebc84d3eb8348a2425aad2a Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 11:03:46 -0400 Subject: [PATCH 05/17] add list with single quotes around container for line 160 --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 5e0c0268e..0563a8d4e 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -157,7 +157,7 @@ jobs: sha: ${{ steps.get_sha.outputs.sha }} strategy: matrix: - test_container: ${{ needs.run-type-container.outputs.test_container }} + test_container: ['${{ needs.run-type-container.outputs.test_container }}'] steps: - name: Login in Github Container registry uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 From 1954bb1af479846ce470edc2d8164f4e3b7ff5c2 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 11:38:30 -0400 Subject: [PATCH 06/17] change mechanical-version to mechanical-image --- .github/workflows/ci_cd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 0563a8d4e..cf9c9de9b 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -218,7 +218,7 @@ jobs: fi remote-connect: - name: Remote connect testing and coverage - Mechanical ${{ matrix.mechanical-version }} + name: Remote connect testing and coverage - Mechanical ${{ matrix.mechanical-image }} runs-on: public-ubuntu-latest-8-cores needs: [style, run-type-container, config-matrix] continue-on-error: ${{ matrix.experimental }} @@ -278,7 +278,7 @@ jobs: - name: Upload coverage results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: matrix.mechanical-version == needs.run-type-container.outputs.test_container + if: matrix.mechanical-image == needs.run-type-container.outputs.test_container with: include-hidden-files: true name: coverage-tests @@ -287,7 +287,7 @@ jobs: - name: Upload coverage results (as .coverage) uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: matrix.mechanical-version == needs.run-type-container.outputs.test_container + if: matrix.mechanical-image == needs.run-type-container.outputs.test_container with: include-hidden-files: true name: coverage-file-tests From 734e0619a78656d41c1ec3ef084812a9e4dc1302 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 12:49:55 -0400 Subject: [PATCH 07/17] save is_dev_container to github output --- .github/workflows/ci_cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index cf9c9de9b..d8139b334 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -73,6 +73,7 @@ jobs: fi echo "test=$test" >> $GITHUB_OUTPUT + echo "is_dev_container=$is_dev_container" >> $GITHUB_OUTPUT update-changelog: name: "Update CHANGELOG for new tag" From 72da3f1f2902c152059a2a05236c4c963d71d493 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 12:56:17 -0400 Subject: [PATCH 08/17] fix conditions? --- .github/workflows/setup-python/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index 6f730b40f..4ca5b08ca 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -45,14 +45,14 @@ runs: using: "composite" steps: - name: "Set up Python ${{ inputs.python-version }}" - if: ${{ inputs.is-dev-container == true }} + if: ${{ inputs.is-dev-container == "true" }} uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: ${{ inputs.python-version }} cache: "pip" - name: Get most recent Python version - if: ${{ inputs.is-dev-container == false }} + if: ${{ inputs.is-dev-container == "false" }} shell: bash run: | declare -A python_versions=(["3.10"]="3.10.18" ["3.11"]="3.11.13" ["3.12"]="3.12.11" ["3.13"]="3.13.7") @@ -75,7 +75,7 @@ runs: - name: "Cache Python directories" id: cache-python - if: ${{ inputs.is-dev-container == false }} + if: ${{ inputs.is-dev-container == "false" }} uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: | From 346c49202e76f6201025886c721abc775123f332 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 13:03:49 -0400 Subject: [PATCH 09/17] fix inputs? --- .github/workflows/setup-python/action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index 4ca5b08ca..ee10ea9d7 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -45,14 +45,14 @@ runs: using: "composite" steps: - name: "Set up Python ${{ inputs.python-version }}" - if: ${{ inputs.is-dev-container == "true" }} + if: inputs.is-dev-container == 'true' uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: ${{ inputs.python-version }} cache: "pip" - name: Get most recent Python version - if: ${{ inputs.is-dev-container == "false" }} + if: inputs.is-dev-container == 'false' shell: bash run: | declare -A python_versions=(["3.10"]="3.10.18" ["3.11"]="3.11.13" ["3.12"]="3.12.11" ["3.13"]="3.13.7") @@ -75,7 +75,7 @@ runs: - name: "Cache Python directories" id: cache-python - if: ${{ inputs.is-dev-container == "false" }} + if: inputs.is-dev-container == 'false' uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: | @@ -87,14 +87,14 @@ runs: python${{ inputs.python-version }}-dirs - name: "Confirm Python is installed" - if: ${{ steps.cache-python.outputs.cache-hit == 'true' && inputs.is-dev-container == false }} + if: ${{ steps.cache-python.outputs.cache-hit == 'true' && inputs.is-dev-container == 'false' }} shell: bash run: | python_location=$(which python${{ inputs.python-version }}) echo "Python ${{ inputs.python-version }} found at $python_location" - name: "Install Python ${{ env.PYTHON_VERSION_PATCH }}" - if: ${{ steps.cache-python.outputs.cache-hit != 'true' && inputs.is-dev-container == false }} + if: ${{ steps.cache-python.outputs.cache-hit != 'true' && inputs.is-dev-container == 'false' }} shell: bash run: | # Update package lists From baec44b50fa005ab198448d8bbe5bb2917366003 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 13:22:27 -0400 Subject: [PATCH 10/17] apt install before python installation --- .github/workflows/setup-python/action.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index ee10ea9d7..d39e33a55 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -44,6 +44,13 @@ inputs: runs: using: "composite" steps: + - name: "Install necessary packages" + shell: bash + run: | + # Install sqlite3, libsqlite3-dev, and lsb-release + apt-get update + apt-get install sqlite3 libsqlite3-dev lsb-release -y + - name: "Set up Python ${{ inputs.python-version }}" if: inputs.is-dev-container == 'true' uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 @@ -135,10 +142,6 @@ runs: # Link python to the installed version ln -s $python_location /usr/bin/python - # Install sqlite3 and libsqlite3-dev - apt-get update - apt-get install sqlite3 libsqlite3-dev lsb-release -y - # Verify Python installation python -m ensurepip --default-pip python -m pip install --upgrade pip From 2e42ae90796c88a5a63472fda13c78a8a2fd6743 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 14:33:27 -0400 Subject: [PATCH 11/17] install pip after python setup if dev container --- .github/workflows/setup-python/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index d39e33a55..7ebdd68e0 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -56,7 +56,12 @@ runs: uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: ${{ inputs.python-version }} - cache: "pip" + + - name: "Install pip" + if: inputs.is-dev-container == 'true' + shell: bash + run: | + python -m pip install -U pip - name: Get most recent Python version if: inputs.is-dev-container == 'false' From 3eb37d8fe8ef2e297a3b34eb69db7d70a6ed22d3 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 15:28:50 -0400 Subject: [PATCH 12/17] apt install libc6 --- .github/workflows/setup-python/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index 7ebdd68e0..84e686197 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -49,7 +49,7 @@ runs: run: | # Install sqlite3, libsqlite3-dev, and lsb-release apt-get update - apt-get install sqlite3 libsqlite3-dev lsb-release -y + apt-get install sqlite3 libsqlite3-dev lsb-release libc6 -y - name: "Set up Python ${{ inputs.python-version }}" if: inputs.is-dev-container == 'true' From 1577b61f118854c5266a44f30b425739a7c81d4d Mon Sep 17 00:00:00 2001 From: kmcadams Date: Mon, 29 Sep 2025 15:44:08 -0400 Subject: [PATCH 13/17] upgrade the system --- .github/workflows/setup-python/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index 84e686197..a0e42deb2 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -49,6 +49,7 @@ runs: run: | # Install sqlite3, libsqlite3-dev, and lsb-release apt-get update + apt-get upgrade -y apt-get install sqlite3 libsqlite3-dev lsb-release libc6 -y - name: "Set up Python ${{ inputs.python-version }}" From 191875050e347044b98cb15d3d2dd919822fde63 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Tue, 30 Sep 2025 13:22:30 -0400 Subject: [PATCH 14/17] remove pip install section --- .github/workflows/setup-python/action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index a0e42deb2..ad9669983 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -58,12 +58,6 @@ runs: with: python-version: ${{ inputs.python-version }} - - name: "Install pip" - if: inputs.is-dev-container == 'true' - shell: bash - run: | - python -m pip install -U pip - - name: Get most recent Python version if: inputs.is-dev-container == 'false' shell: bash From 8e6b676561045fd8be82f89a950d789946cb2da3 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Tue, 30 Sep 2025 13:31:09 -0400 Subject: [PATCH 15/17] add comments --- .github/workflows/setup-python/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/setup-python/action.yml b/.github/workflows/setup-python/action.yml index ad9669983..bf9c7e3c7 100644 --- a/.github/workflows/setup-python/action.yml +++ b/.github/workflows/setup-python/action.yml @@ -140,11 +140,15 @@ runs: python_location=$(which python${{ inputs.python-version }}) # Link python to the installed version + echo "linking python to usr bin python" ln -s $python_location /usr/bin/python # Verify Python installation + echo "ensuring pip" python -m ensurepip --default-pip + echo "upgrading pip" python -m pip install --upgrade pip + echo "making venv" python -m venv /env - name: "Check the virtual environment Python can be used" From 55bcc50e82c0013329e5a9ed38153873d4855e45 Mon Sep 17 00:00:00 2001 From: kmcadams Date: Tue, 30 Sep 2025 13:47:53 -0400 Subject: [PATCH 16/17] change runner image to ubuntu-22.04 --- .github/workflows/ci_cd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 604c3396a..94527f32d 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -313,7 +313,7 @@ jobs: embedding-tests: name: Embedding testing and coverage - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 # ubuntu-latest timeout-minutes: 30 needs: [run-type-container, test-container-info, container-stability-check, smoke-tests] container: @@ -386,7 +386,7 @@ jobs: embedding-scripts-tests: name: Embedding scripts testing and coverage - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 # ubuntu-latest timeout-minutes: 30 needs: [smoke-tests, run-type-container, test-container-info] container: @@ -536,7 +536,7 @@ jobs: doc-build: name: Documentation - runs-on: public-ubuntu-latest-8-cores + runs-on: ubuntu-22.04 # public-ubuntu-latest-8-cores timeout-minutes: 30 container: image: ${{ needs.run-type-container.outputs.test_container }} From 70c6e1e0e682ed0ce6dbfdf580203bba99dcad25 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:33:43 +0000 Subject: [PATCH 17/17] chore: adding changelog file 1344.test.md [dependabot-skip] --- doc/changelog.d/1344.test.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/1344.test.md diff --git a/doc/changelog.d/1344.test.md b/doc/changelog.d/1344.test.md new file mode 100644 index 000000000..4354b2bc5 --- /dev/null +++ b/doc/changelog.d/1344.test.md @@ -0,0 +1 @@ +Mechanical container using Ubuntu 22.04