Skip to content

Commit

Permalink
Adding files to pull request (#2359)
Browse files Browse the repository at this point in the history
* Checking workflow

* Deactivating stuff for test

* Show GitHub Actions logo

* checking without user config

* Retrigger

* Retrigger

* Update the image cache

* Adding comment if re-trigger

* Update the image cache

* Update message. Fix link

* Update the image cache

* Renaming user. Fixing sha

* Reactivating stuff

* Fixing when no changes

* Adding safe.directory configuration

* Update the image cache

* resetting image cache to main

* using pytest-pyvista from main branch. Implementing changes in ci.yml

* using reset

* Using --ignore_image_cache

* remove flag

* Checking background change

* Update the image cache

* resetting image cache to main

* Revert "Checking background change"

This reverts commit b0ee04d.

* More info in the bot message

* Applying review requested changes

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: germa89 <[email protected]>
  • Loading branch information
3 people committed Oct 2, 2023
1 parent 8a4235e commit 727dde9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ jobs:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
timeout-minutes: 55
outputs:
pushed: ${{ steps.attatch-to-pr.outputs.pushed }}
committed: ${{ steps.attatch-to-pr.outputs.committed }}
commit_long_sha: ${{ steps.attatch-to-pr.outputs.commit_long_sha }}
container:
image: ghcr.io/ansys/mapdl:v22.2-ubuntu
options: "-u=0:0 --entrypoint /bin/bash"
Expand All @@ -462,6 +466,9 @@ jobs:
steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: "Setup Python"
uses: actions/setup-python@v4
Expand Down Expand Up @@ -509,8 +516,42 @@ jobs:
export AWP_ROOT222=/ansys_inc
xvfb-run pytest -k "not test_database and not test_dpf" \
${{ env.PYTEST_ARGUMENTS }} \
--reset_only_failed \
--cov-report=xml:ubuntu-v22.2.0-local.xml
- name: "Adding the directory as safe directory for later step"
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
- name: "Attaching modified files to PR"
id: attatch-to-pr
uses: EndBug/add-and-commit@v9
with:
message: Update the image cache
committer_name: GitHub Actions
committer_email: [email protected]
add: './tests/.image_cache/*.png'

- name: "PR comment with reactions"
if: ${{ steps.attatch-to-pr.outputs.pushed == 'true' }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Hello! :wave:
Your PR is changing the image cache. So I am attaching the new image cache
in a new [commit](https://github.com/ansys/pymapdl/commit/${{ steps.attatch-to-pr.outputs.commit_long_sha }}).
This commit does not re-run the CICD workflows (since no changes are made in the codebase) therefore
you will see the actions showing in their status `Expected — Waiting for status to be reported`. Do not worry.
You commit workflow is still running [here](https://github.com/ansys/pymapdl/pull/${{ github.event.pull_request.number }}/checks?sha=${{ github.event.pull_request.head.sha }}) :smile:
You might want to rerun the test to make sure that everything is passing. You can retrigger the CICD sending an empty commit `git commit -m "Empty comment to trigger CICD" --allow-empty`.
You will see this message everytime your commit changes the image cache but you are not attaching the updated cache. :nerd_face:
reactions: rocket

- uses: codecov/codecov-action@v3
name: "Upload coverage to Codecov"
with:
Expand Down Expand Up @@ -579,6 +620,7 @@ jobs:
set PYMAPDL_START_INSTANCE=
python -m pytest -k "not test_database and not test_dpf" \
${{ env.PYTEST_ARGUMENTS }} \
--skip-regression-check \
--cov-report=xml:windows-v22.2.0-local.xml
- uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ tests = [
"pyansys-tools-report==0.6.0",
"vtk==9.2.6",
"pytest-rerunfailures==12.0",
"pytest-pyvista==0.1.8",
"pytest-pyvista==0.1.9",
]
doc = [
"sphinx==7.2.6",
Expand Down

0 comments on commit 727dde9

Please sign in to comment.