Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ccpansys/solutions e2e testing #384

Merged
merged 14 commits into from
Oct 30, 2023
43 changes: 43 additions & 0 deletions .github/workflows/solutions_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI for SAF templates
ccpansys marked this conversation as resolved.
Show resolved Hide resolved
on:
pull_request:
ccpansys marked this conversation as resolved.
Show resolved Hide resolved

jobs:
check-solution-templates-changes:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.check.outputs.has_changes}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for changes
id: check
run: |
CHANGES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- './src/ansys/templates/python/solution' './src/ansys/templates/python/osl_solution')
if [ -z "$CHANGES" ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No changes in the solution templates."
else
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "Found changes in the solution templates."
fi

ccpansys marked this conversation as resolved.
Show resolved Hide resolved
solutions-e2e-tests:
needs: [check-solution-templates-changes]
if: |
needs.check-solution-templates-changes.outputs.changed == 'true'
name: Trigger solutions e2e tests
runs-on: ubuntu-latest
steps:
- name: github workflow dispatch
shell: bash
run: |
curl -L \
ccpansys marked this conversation as resolved.
Show resolved Hide resolved
-X POST \
-H 'Accept: application/vnd.github+json' \
ccpansys marked this conversation as resolved.
Show resolved Hide resolved
-H "Authorization: Bearer ${{ secrets.ANSYS_SOLUTIONS_E2E_TESTS }}"\
ccpansys marked this conversation as resolved.
Show resolved Hide resolved
"https://api.github.com/repos/Solution-Applications/solution-templates-end-to-end-testing/actions/workflows/_ansys-templates-remote-ci.yml/dispatches" \
-d '{"ref":"refs/heads/main", "inputs":{"ansys_templates_sha": "${{ github.event.pull_request.head.sha }}"}}'
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
|python|

.. note::
This content needs to be configured according to the project specifics.
This content needs to be configured according to the project specifics.


Introduction
Expand Down
Loading