Skip to content

Testing - Add PR comment with artifact link for test results #50

Testing - Add PR comment with artifact link for test results

Testing - Add PR comment with artifact link for test results #50

# This workflow builds and tests OCCT on multiple platforms (Windows, macOS, Linux with Clang, and Linux with GCC).
# It is triggered on pull requests to any branch.
# The workflow includes steps to prepare and build the project on each platform, run tests, and upload the results.
# Concurrency is set to ensure that only one instance of the workflow runs per pull request at a time.
name: Build and Test OCCT on Multiple Platforms
on:
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
issues: write
pull-requests: write
jobs:
summarize:
name: Summarize and Send PR Message
runs-on: ubuntu-24.04
steps:
- name: Comment on PR with artifact link
run: |
# Use GitHub API to create a comment on the PR
PR_NUMBER=${{ github.event.pull_request.number }}
COMMENT="Test results are available [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})."
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"