Skip to content

Commit

Permalink
Update github workflows (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoNegri authored Sep 15, 2023
1 parent 716f815 commit caf4bb2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 12 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ jobs:
submodules: true
path: rep-deployments

- uses: dawidd6/action-download-artifact@v2
with:
workflow: main.yaml
name: docker-compose-internal
path: docker-compose-artifact/
branch: main
repo: ansys-internal/rep-deployments
workflow_conclusion: success
search_artifacts: false
github_token: ${{secrets.PYANSYS_CI_BOT_TOKEN}}

- uses: KengoTODA/actions-setup-docker-compose@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -75,12 +86,15 @@ jobs:

- name: Start services
run: |
ls -la
tar -xvzf docker-compose-internal.tar.gz
cd docker-compose
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev docker-compose pull
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d keycloak
echo "Waiting a few sec ..."
sleep 5
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d
working-directory: ./rep-deployments/docker-compose
working-directory: ./docker-compose-artifact

- name: Test with tox
run: tox -e ${{ matrix.cfg.toxenv }}-noeval-coverage
Expand All @@ -97,6 +111,12 @@ jobs:
check_name: Test Report ${{ matrix.os }}:${{ matrix.cfg.python-version }}
detailed_summary: true
include_passed: true

- name: Stop services
if: always()
run: |
docker-compose down -v
working-directory: ./docker-compose-artifact/docker-compose

docs:
name: Documentation
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
os: [ubuntu-latest]
cfg:
- {python-version: "3.7", toxenv: "py37"}
- {python-version: "3.10", toxenv: "py310"}
- {python-version: "3.11", toxenv: "py311"}
fail-fast: false

steps:
Expand All @@ -53,13 +53,16 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools tox tox-gh-actions
- name: Check out rep-deployments
uses: actions/checkout@v3
- uses: dawidd6/action-download-artifact@v2
with:
repository: ansys-internal/rep-deployments
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
submodules: true
path: rep-deployments
workflow: main.yaml
name: docker-compose-internal
path: docker-compose-artifact/
branch: main
repo: ansys-internal/rep-deployments
workflow_conclusion: success
search_artifacts: false
github_token: ${{secrets.PYANSYS_CI_BOT_TOKEN}}

- uses: KengoTODA/actions-setup-docker-compose@main
env:
Expand All @@ -74,12 +77,15 @@ jobs:

- name: Start services
run: |
ls -la
tar -xvzf docker-compose-internal.tar.gz
cd docker-compose
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev docker-compose pull
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d keycloak
echo "Waiting a few sec ..."
sleep 5
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d
working-directory: ./rep-deployments/docker-compose
working-directory: ./docker-compose-artifact

- name: Test with tox
run: tox -e ${{ matrix.cfg.toxenv }}-noeval-coverage
Expand All @@ -95,6 +101,12 @@ jobs:
report_paths: '**/test*.xml'
check_name: Test Report ${{ matrix.os }}:${{ matrix.cfg.python-version }}

- name: Stop services
if: always()
run: |
docker-compose down -v
working-directory: ./docker-compose-artifact/docker-compose

end-to-end-tests:
name: End-to-end tests
runs-on: windows-latest
Expand Down
9 changes: 6 additions & 3 deletions tests/jms/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from examples.mapdl_motorbike_frame.project_setup import create_project as motorbike_create_project
from marshmallow.utils import missing

from ansys.rep.client import __ansys_apps_version__ as ansys_version
from ansys.rep.client.jms import JmsApi, ProjectApi
from ansys.rep.client.jms.resource import JobDefinition, LicenseContext, Project
from ansys.rep.client.jms.schema.project import ProjectSchema
Expand Down Expand Up @@ -273,9 +274,11 @@ def test_copy_exec_script(self):
proj = jms_api.create_project(proj)

project_api = ProjectApi(client, proj.id)
file = project_api.copy_default_execution_script("exec_mapdl.py")
self.assertEqual(file.name, "exec_mapdl")
self.assertEqual(file.evaluation_path, "exec_mapdl.py")
ansys_short_version = f"v{ansys_version[2:4]}{ansys_version[6]}"
script_name = f"mapdl-{ansys_short_version}-exec_mapdl"
file = project_api.copy_default_execution_script(f"{script_name}.py")
self.assertEqual(file.name, script_name)
self.assertEqual(file.evaluation_path, f"{script_name}.py")
self.assertIsNotNone(file.hash)
self.assertIsNotNone(file.storage_id)

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py: python3
{style,reformat,doc,build}: python3
passenv = REP_TEST_*
Expand Down

0 comments on commit caf4bb2

Please sign in to comment.