From 5dd12cf5b93d4244506736dce97ade94c5e9c677 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 17 Jun 2024 08:50:03 -0500 Subject: [PATCH 1/8] add version input to dispatch --- .github/workflows/ci_cd.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 85aefdf4f..b8ff434a9 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -3,6 +3,11 @@ name: GitHub CI on: pull_request: workflow_dispatch: + inputs: + test-version: + description: 'Test version' + required: false + default: '1' schedule: - cron: '00 22 * * *' # UTC time, may start 5-15 mins later than scheduled time # registry_package: @@ -15,6 +20,8 @@ on: - main - release/* + + env: PYMECHANICAL_PORT: 10000 # default won't work on GitHub runners PYMECHANICAL_START_INSTANCE: false From 5e2c8c1518230e17e1c96ae07061ea6d592e7714 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 17 Jun 2024 09:11:15 -0500 Subject: [PATCH 2/8] use variable --- .github/workflows/ci_cd.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b8ff434a9..1b878580c 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -5,9 +5,9 @@ on: workflow_dispatch: inputs: test-version: - description: 'Test version' + description: 'docker image version tag, 24.1.0, 24.2.0, etc' required: false - default: '1' + default: '0' schedule: - cron: '00 22 * * *' # UTC time, may start 5-15 mins later than scheduled time # registry_package: @@ -114,7 +114,13 @@ jobs: steps: - id: save-versions run: | - if ${{ github.event_name == 'schedule' }}; then + if "$INPUT_TEST_VERSION" != "0" ; then + echo "test_revn=$INPUT_TEST_VERSION" >> $GITHUB_OUTPUT + # ghcr.io/ansys/mechanical:INPUT_TEST_VERSION + echo "test_container=${{ env.DOCKER_PACKAGE }}:$INPUT_TEST_VERSION" >> $GITHUB_OUTPUT + # INPUT_TEST_VERSION + echo "test_docker_image_version=$INPUT_TEST_VERSION" >> $GITHUB_OUTPUT + elif ${{ github.event_name == 'schedule' }}; then # 242 echo "test_revn=${{ env.DEV_REVN }}" >> $GITHUB_OUTPUT # ghcr.io/ansys/mechanical:24.2_candidate From 4b7045d03ec0925af60effda370df35bf03cea0d Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 17 Jun 2024 09:23:01 -0500 Subject: [PATCH 3/8] try again --- .github/workflows/ci_cd.yml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 1b878580c..010455e10 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -4,10 +4,14 @@ on: pull_request: workflow_dispatch: inputs: - test-version: - description: 'docker image version tag, 24.1.0, 24.2.0, etc' - required: false - default: '0' + revn: + type: choice + options: + - '251' + - '242' + - '241' + description: 'The Mechanical revision number to run tests on.' + default: '241' #must match env/LATEST_STABLE_REVN schedule: - cron: '00 22 * * *' # UTC time, may start 5-15 mins later than scheduled time # registry_package: @@ -114,26 +118,21 @@ jobs: steps: - id: save-versions run: | - if "$INPUT_TEST_VERSION" != "0" ; then - echo "test_revn=$INPUT_TEST_VERSION" >> $GITHUB_OUTPUT - # ghcr.io/ansys/mechanical:INPUT_TEST_VERSION - echo "test_container=${{ env.DOCKER_PACKAGE }}:$INPUT_TEST_VERSION" >> $GITHUB_OUTPUT - # INPUT_TEST_VERSION - echo "test_docker_image_version=$INPUT_TEST_VERSION" >> $GITHUB_OUTPUT - elif ${{ github.event_name == 'schedule' }}; then + if ${{ github.event_name == 'schedule' }}; then # 242 - echo "test_revn=${{ env.DEV_REVN }}" >> $GITHUB_OUTPUT + echo "test_revn=${{ inputs.mech_revn }}" >> $GITHUB_OUTPUT # ghcr.io/ansys/mechanical:24.2_candidate echo "test_container=${{ env.DOCKER_PACKAGE }}:${{ env.DEV_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT # 24.2_candidate echo "test_docker_image_version=${{ env.DEV_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT else - # 241 + mech_revn = "${{inputs.revn}}" + mech_image_version = "${mech_revn:0:2}.${mech_revn:2}.0" echo "test_revn=${{ env.LATEST_STABLE_REVN }}" >> $GITHUB_OUTPUT # ghcr.io/ansys/mechanical:24.1.0 - echo "test_container=${{ env.DOCKER_PACKAGE }}:${{ env.LATEST_STABLE_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT + echo "test_container=${{ env.DOCKER_PACKAGE }}:$mech_image_version" >> $GITHUB_OUTPUT # 24.1.0 - echo "test_docker_image_version=${{ env.LATEST_STABLE_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT + echo "test_docker_image_version=$mech_image_version" >> $GITHUB_OUTPUT fi echo "stable_container=${{ env.DOCKER_PACKAGE }}:${{ env.LATEST_STABLE_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT @@ -322,7 +321,7 @@ jobs: name: Embedding scripts testing and coverage runs-on: ubuntu-latest timeout-minutes: 10 - needs: [smoke-tests, revn-variations] + needs: [revn-variations] container: image: ${{ needs.revn-variations.outputs.test_container }} options: --entrypoint /bin/bash From 7993ccdf74b00c453b179053475657fc58d16dd6 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 17 Jun 2024 09:31:05 -0500 Subject: [PATCH 4/8] fix --- .github/workflows/ci_cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 010455e10..37dbc059f 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -126,8 +126,8 @@ jobs: # 24.2_candidate echo "test_docker_image_version=${{ env.DEV_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT else - mech_revn = "${{inputs.revn}}" - mech_image_version = "${mech_revn:0:2}.${mech_revn:2}.0" + export mech_revn="${{inputs.revn}}" + export mech_image_version="${mech_revn:0:2}.${mech_revn:2}.0" echo "test_revn=${{ env.LATEST_STABLE_REVN }}" >> $GITHUB_OUTPUT # ghcr.io/ansys/mechanical:24.1.0 echo "test_container=${{ env.DOCKER_PACKAGE }}:$mech_image_version" >> $GITHUB_OUTPUT From 0539240f795c2a0dd2e0a1afc581ba4f38de4f9c Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot Date: Mon, 17 Jun 2024 14:35:03 +0000 Subject: [PATCH 5/8] Adding changelog entry: 771.changed.md --- doc/changelog.d/771.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/771.changed.md diff --git a/doc/changelog.d/771.changed.md b/doc/changelog.d/771.changed.md new file mode 100644 index 000000000..24ab155c0 --- /dev/null +++ b/doc/changelog.d/771.changed.md @@ -0,0 +1 @@ +Test specific version \ No newline at end of file From f53bb3686740438e1de40eed4d4270c56179a121 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 17 Jun 2024 09:41:31 -0500 Subject: [PATCH 6/8] fix --- .github/workflows/ci_cd.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 37dbc059f..5328b6c97 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -11,7 +11,7 @@ on: - '242' - '241' description: 'The Mechanical revision number to run tests on.' - default: '241' #must match env/LATEST_STABLE_REVN + default: '241' #stable version is 241, must match $stable_container schedule: - cron: '00 22 * * *' # UTC time, may start 5-15 mins later than scheduled time # registry_package: @@ -34,9 +34,6 @@ env: PACKAGE_NAME: ansys-mechanical-core DOCUMENTATION_CNAME: mechanical.docs.pyansys.com MAIN_PYTHON_VERSION: '3.10' - # LATEST_STABLE_REVN and its Docker image are used in pull requests - LATEST_STABLE_REVN: '241' - LATEST_STABLE_DOCKER_IMAGE_VERSION: '24.1.0' # DEV_REVN & its Docker image are used in scheduled or registry package runs DEV_REVN: '242' DEV_DOCKER_IMAGE_VERSION: '24.2_candidate' @@ -126,8 +123,12 @@ jobs: # 24.2_candidate echo "test_docker_image_version=${{ env.DEV_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT else - export mech_revn="${{inputs.revn}}" - export mech_image_version="${mech_revn:0:2}.${mech_revn:2}.0" + if ${{inputs.revn}}; then + export mech_revn=241 + else + export mech_revn=${{inputs.revn}} + fi + export mech_image_version=${mech_revn:0:2}.${mech_revn:2}.0 echo "test_revn=${{ env.LATEST_STABLE_REVN }}" >> $GITHUB_OUTPUT # ghcr.io/ansys/mechanical:24.1.0 echo "test_container=${{ env.DOCKER_PACKAGE }}:$mech_image_version" >> $GITHUB_OUTPUT @@ -135,7 +136,7 @@ jobs: echo "test_docker_image_version=$mech_image_version" >> $GITHUB_OUTPUT fi - echo "stable_container=${{ env.DOCKER_PACKAGE }}:${{ env.LATEST_STABLE_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT + echo "stable_container=${{ env.DOCKER_PACKAGE }}:24.1.0" >> $GITHUB_OUTPUT config-matrix: runs-on: ubuntu-latest From b869d8c161311c0b32ad1b2b890335397f23f14c Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 17 Jun 2024 09:42:30 -0500 Subject: [PATCH 7/8] fix --- .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 5328b6c97..a7ab90d5a 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -123,7 +123,7 @@ jobs: # 24.2_candidate echo "test_docker_image_version=${{ env.DEV_DOCKER_IMAGE_VERSION }}" >> $GITHUB_OUTPUT else - if ${{inputs.revn}}; then + if [[ -z "${{inputs.revn}}" ]]; then export mech_revn=241 else export mech_revn=${{inputs.revn}} From c52ace73fc595e98275bf24b265699297ff64ccc Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Tue, 18 Jun 2024 07:32:44 -0500 Subject: [PATCH 8/8] undo one change in cicd --- .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 a7ab90d5a..9170cf3c0 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -322,7 +322,7 @@ jobs: name: Embedding scripts testing and coverage runs-on: ubuntu-latest timeout-minutes: 10 - needs: [revn-variations] + needs: [smoke-tests, revn-variations] container: image: ${{ needs.revn-variations.outputs.test_container }} options: --entrypoint /bin/bash