Skip to content

Parent Workflow

Parent Workflow #88

name: Parent Workflow
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
permissions:
contents: read
jobs:
labeler:
permissions:
contents: read
pages: write
pull-requests: write
name: Run Labeler Workflow
uses: ./.github/workflows/labeler.yml
with:
artifact_id: "labeler-${{ github.sha }}"
SME_review_checker:
permissions:
contents: read
pull-requests: read
name: Run SME_review_checker Workflow
if: ${{ github.event_name == 'pull_request' }} # only run SME_review_checker for PRs
uses: ./.github/workflows/SME_review_checker.yml
with:
artifact_id: "SME_review_checker-${{ github.sha }}"
check_amalgamation:
name: Run Amalgamation Workflow
if: ${{ github.event_name == 'pull_request' }} # only run check_amalgamation for PRs
uses: ./.github/workflows/check_amalgamation.yml
with:
artifact_id: "check_amalgamation-${{ github.sha }}"
test_trudag_extensions:
name: Run Test Trudag Extensions Workflow
uses: ./.github/workflows/test_trudag_extensions.yml
with:
artifact_id: "test_trudag_extensions-${{ github.sha }}"
codeql:
permissions:
contents: read
security-events: write
name: Run Codeql analysis Workflow
uses: ./.github/workflows/codeql-analysis.yml
with:
artifact_id: "codeql-${{ github.sha }}"
ubuntu:
name: Run Ubuntu Workflow
permissions:
contents: write
needs: [codeql] # Error if CodeQL and Ubuntu triggered at the same time due to conflicting priorities
uses: ./.github/workflows/ubuntu.yml
with:
artifact_id: "ubuntu-${{ github.sha }}"
dependency_review:
name: Run dependency_review Workflow
if: ${{ github.event_name == 'pull_request' }} # only run dependency_review for PRs
uses: ./.github/workflows/dependency-review.yml
with:
artifact_id: "dependency_review-${{ github.sha }}"
collect_artifacts_pr:
name: "Collect Results & Deploy (PR)"
if: github.event_name == 'pull_request'
needs: [labeler, SME_review_checker, check_amalgamation, test_trudag_extensions, dependency_review, codeql, ubuntu]
runs-on: ubuntu-latest
strategy:
matrix:
target: [labeler, SME_review_checker, check_amalgamation, test_trudag_extensions, dependency_review, codeql, ubuntu]
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check child workflow results
run: |
echo "=== Checking Child Workflow Results ==="
result="${{ needs[matrix.target].result }}"
echo "${{ matrix.target }} workflow result: $result"
if [[ "$result" != "success" ]]; then
echo "❌ ${{ matrix.target }} workflow failed! Exiting..."
exit 1
fi
echo "✅ Child workflows completed successfully!"
env:
current_workflow: ${{ matrix.target }}
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: "${{ matrix.target }}-${{ github.sha }}"
path: artifacts/
collect_artifacts_non_pr:
name: "Collect Results & Deploy (Non-PR)"
if: github.event_name != 'pull_request'
needs: [labeler, test_trudag_extensions, codeql, ubuntu] # no check_amalgamation, dependency_review or SME_review_checker if non PR
runs-on: ubuntu-latest
strategy:
matrix:
target: [labeler, test_trudag_extensions, codeql, ubuntu]
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check child workflow results
run: |
echo "=== Checking Child Workflow Results ==="
result="${{ needs[matrix.target].result }}"
echo "${{ matrix.target }} workflow result: $result"
if [[ "$result" != "success" ]]; then
echo "❌ ${{ matrix.target }} workflow failed! Exiting..."
exit 1
fi
echo "✅ Child workflows completed successfully!"
env:
current_workflow: ${{ matrix.target }}
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: "${{ matrix.target }}-${{ github.sha }}"
path: artifacts/
test_publish_documentation:
permissions:
contents: write
pages: write
pull-requests: write
id-token: write
security-events: read
name: Test publish_documentation Workflow
if: github.event_name == 'pull_request' # Whenever on Pull-request, test publication
needs: [collect_artifacts_pr]
uses: ./.github/workflows/test_publication.yml
with:
artifact_id: "ubuntu-${{ github.sha }}"
publish_documentation:
permissions:
contents: write
pages: write
pull-requests: write
id-token: write
security-events: read
name: Run publish_documentation Workflow
if: github.event_name == 'push' # Publish documentation should only run on push to main
needs: [collect_artifacts_non_pr]
uses: ./.github/workflows/publish_documentation.yml
with:
artifact_id: "ubuntu-${{ github.sha }}"