Factor out tracking, update all CIs to full sequence, use it in ECAL veto #425
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Validation | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [trunk] | |
types: [opened, ready_for_review] | |
issue_comment: | |
types: [created] | |
env: | |
LDMX_DOCKER_TAG: ldmx/dev:latest | |
LDMX_NUM_EVENTS: 10000 | |
jobs: | |
check-comment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Post the workflow run for comment based trigger | |
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '/run-validation') }} | |
run: | | |
COMMENT="The validation workflow is running here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}." | |
curl -s -X POST \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-d '{"body": "'"$COMMENT"'"}' \ | |
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" | |
compile-ldmx-sw: | |
needs: check-comment | |
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/run-validation')) | |
runs-on: ubuntu-latest | |
outputs: | |
job_matrix: ${{steps.gen-mat.outputs.job_matrix}} | |
steps: | |
- name: Checkout ldmx-sw | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
fetch-depth: 0 | |
- name: Install just | |
uses: extractions/setup-just@v2 | |
with: | |
just-version: 1.26.0 | |
- name: Compile and Install ldmx-sw | |
run: | | |
just install-denv init configure-force-error | |
just build | |
shell: bash | |
- name: Git Gold Histograms from trunk | |
run: git checkout origin/trunk -- .github/validation_samples/*/gold.root VERSION | |
shell: bash | |
- name: Package ldmx-sw Into Artifact | |
run: tar cf ldmx-sw-package.tar install/ .github/ VERSION | |
- name: Upload ldmx-sw Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ldmx-sw-build-${{ github.sha }} | |
path: ldmx-sw-package.tar | |
- name: Generate Job Matrix | |
id: gen-mat | |
uses: ./.github/actions/generate-matrix | |
validation: | |
needs: compile-ldmx-sw | |
runs-on: ubuntu-latest | |
env: | |
LDMX_RUN_NUMBER: ${{matrix.run}} | |
strategy: | |
matrix: ${{fromJson(needs.compile-ldmx-sw.outputs.job_matrix)}} | |
fail-fast: false | |
steps: | |
- name: Download ldmx-sw Package | |
uses: actions/download-artifact@v4 | |
with: | |
name: ldmx-sw-build-${{ github.sha }} | |
- name: Unpack ldmx-sw Build | |
run: | | |
cd ${GITHUB_WORKSPACE} | |
tar xf ldmx-sw-package.tar | |
- name: Run Validation | |
id: validation | |
uses: ./.github/actions/validate | |
with: | |
sample: ${{matrix.sample}} | |
- name: Upload Validation Plots | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{matrix.sample}}-pr-validation | |
path: ${{ steps.validation.outputs.plots }} | |
- name: Did any validation plots fail? | |
uses: ./.github/actions/check | |
with: | |
plots: ${{ steps.validation.outputs.plots }} | |