Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 55 additions & 57 deletions .github/workflows/test-podman-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ jobs:
make install > /dev/null

- name: Run Fluent test script
id: fluent_test
run: |
python tests/podman_compose.py
continue-on-error: true

- name: Cleanup previous containers
if: always()
Expand All @@ -121,62 +123,58 @@ jobs:
sudo podman system prune -af

- name: Send GitHub Actions Run Status Adaptive Card to Teams via Power Automate
if: github.event_name == 'schedule' && always()
if: github.event_name == 'schedule' && steps.fluent_test.outcome != 'success'
run: | # zizmor: ignore[template-injection]
if [ "${{ job.status }}" != "success" ]; then
STATUS="Failure"
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"

JSON_PAYLOAD=$(jq -n \
--arg status "$STATUS" \
--arg branch "${{ github.ref_name }}" \
--arg commit "${{ github.sha }}" \
--arg commit_url "$COMMIT_URL" \
--arg run_url "$RUN_URL" \
'{
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"weight": "Bolder",
"size": "Medium",
"text": "${{ github.workflow }}"
},
{
"type": "TextBlock",
"text": "Status: \($status)"
},
{
"type": "TextBlock",
"text": "Branch: \($branch)"
},
{
"type": "TextBlock",
"text": "Commit: \($commit)"
},
{
"type": "TextBlock",
"text": "[View Commit](\($commit_url))"
},
{
"type": "TextBlock",
"text": "[View Run](\($run_url))"
}
]
}
STATUS="Failure"
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"

JSON_PAYLOAD=$(jq -n \
--arg status "$STATUS" \
--arg branch "${{ github.ref_name }}" \
--arg commit "${{ github.sha }}" \
--arg commit_url "$COMMIT_URL" \
--arg run_url "$RUN_URL" \
'{
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"weight": "Bolder",
"size": "Medium",
"text": "${{ github.workflow }}"
},
{
"type": "TextBlock",
"text": "Status: \($status)"
},
{
"type": "TextBlock",
"text": "Branch: \($branch)"
},
{
"type": "TextBlock",
"text": "Commit: \($commit)"
},
{
"type": "TextBlock",
"text": "[View Commit](\($commit_url))"
},
{
"type": "TextBlock",
"text": "[View Run](\($run_url))"
}
]
}
]
}'
)

echo "Sending notification to Power Automate..."
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
else
echo "Job status is success. No notification will be sent."
fi
}
]
}'
)

echo "Sending notification to Power Automate..."
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
114 changes: 56 additions & 58 deletions .github/workflows/test-run-dev-version-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ jobs:
make install > /dev/null

- name: Unit Testing
id: unittest
run: |
make install-test
make unittest-all-${VERSION}
env:
VERSION: ${{ env.FLUENT_VERSION }}
FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }}
continue-on-error: true

- name: Cleanup previous docker containers
if: always()
Expand All @@ -103,7 +105,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_ACCESS_TOKEN }}
IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }}
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && steps.unittest.outcome == 'success'
run: |
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/ansys/fluent:${IMAGE_TAG} | sed 's/.*@//')
gh variable set FLUENT_STABLE_IMAGE_DEV --body $DIGEST
Expand All @@ -113,62 +115,58 @@ jobs:
run: make docker-clean-images

- name: Send GitHub Actions Run Status Adaptive Card to Teams via Power Automate
if: github.event_name == 'schedule' && always()
if: github.event_name == 'schedule' && steps.fluent_test.outcome != 'success'
run: | # zizmor: ignore[template-injection]
if [ "${{ job.status }}" != "success" ]; then
STATUS="Failure"
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"

JSON_PAYLOAD=$(jq -n \
--arg status "$STATUS" \
--arg branch "${{ github.ref_name }}" \
--arg commit "${{ github.sha }}" \
--arg commit_url "$COMMIT_URL" \
--arg run_url "$RUN_URL" \
'{
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"weight": "Bolder",
"size": "Medium",
"text": "${{ github.workflow }}"
},
{
"type": "TextBlock",
"text": "Status: \($status)"
},
{
"type": "TextBlock",
"text": "Branch: \($branch)"
},
{
"type": "TextBlock",
"text": "Commit: \($commit)"
},
{
"type": "TextBlock",
"text": "[View Commit](\($commit_url))"
},
{
"type": "TextBlock",
"text": "[View Run](\($run_url))"
}
]
}
STATUS="Failure"
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"

JSON_PAYLOAD=$(jq -n \
--arg status "$STATUS" \
--arg branch "${{ github.ref_name }}" \
--arg commit "${{ github.sha }}" \
--arg commit_url "$COMMIT_URL" \
--arg run_url "$RUN_URL" \
'{
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"weight": "Bolder",
"size": "Medium",
"text": "${{ github.workflow }}"
},
{
"type": "TextBlock",
"text": "Status: \($status)"
},
{
"type": "TextBlock",
"text": "Branch: \($branch)"
},
{
"type": "TextBlock",
"text": "Commit: \($commit)"
},
{
"type": "TextBlock",
"text": "[View Commit](\($commit_url))"
},
{
"type": "TextBlock",
"text": "[View Run](\($run_url))"
}
]
}
]
}'
)

echo "Sending notification to Power Automate..."
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
else
echo "Job status is success. No notification will be sent."
fi
}
]
}'
)

echo "Sending notification to Power Automate..."
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
1 change: 1 addition & 0 deletions doc/changelog.d/4562.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Notify only when job fails