add Calorimeter detector and output scheme #600
Workflow file for this run
This file contains hidden or 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
| # NOTE: this workflow file is the only one allowed to be run on self-hosted | |
| # runners. don't change its name! | |
| name: Validation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - "releases/**" | |
| paths-ignore: | |
| - "**.md" | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - labeled | |
| release: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| run_validation: | |
| name: Run validation suite | |
| runs-on: self-hosted # ubuntu-latest | |
| # Run rules: | |
| # - always run for releases | |
| # - for PRs: only when label "run validation" exists | |
| # - for pushes to main: skip when commit message contains "[skip val]" | |
| if: > | |
| github.event_name == 'release' || | |
| ( | |
| github.event_name == 'pull_request' && | |
| ( | |
| ( | |
| github.event.action == 'labeled' && | |
| github.event.label.name == 'run-validation' | |
| ) || | |
| ( | |
| github.event.action != 'labeled' && | |
| contains(join(github.event.pull_request.labels.*.name, ','), 'run-validation') | |
| ) | |
| ) | |
| ) || | |
| ( | |
| github.event_name == 'push' && | |
| !contains(github.event.head_commit.message, '[skip val]') | |
| ) | |
| container: docker://legendexp/remage-base:stable | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| ref: ${{ github.event.pull_request && github.event.pull_request.head.sha || github.ref }} | |
| - name: Build project | |
| shell: bash # make the pipes to tee below propagate errors (pipefail is on by default). | |
| run: | | |
| git config --global --add safe.directory $(pwd) # make git work inside container. | |
| mkdir build | |
| cd build | |
| cmake -DBUILD_TESTING=ON -DRMG_BUILD_DOCS=OFF .. | tee -a build.log | |
| make -j$(nproc) | tee -a build.log | |
| make install | tee -a build.log | |
| - name: Run validation test suite | |
| run: | | |
| cd build | |
| ctest --label-regex val --label-exclude mt -j$(nproc) --output-on-failure | |
| ctest --label-regex val --label-regex mt -j1 --output-on-failure | |
| - name: Build validation report | |
| run: | | |
| cd build | |
| cmake -DRMG_BUILD_DOCS=ON .. | |
| make sphinx-validation | |
| - name: Disk space statistics | |
| run: | | |
| cd build/tests | |
| du -sh * | |
| df -h . | |
| - name: Upload validation report to GitHub | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: remage-validation-report | |
| path: build/docs/validation/_build/ | |
| deploy_validation_report: | |
| name: Deploy validation report to legend-exp.github.io/remage/validation | |
| if: github.event_name != 'pull_request' | |
| needs: run_validation | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pages: write | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: remage-validation-report | |
| path: output/ | |
| - name: Determine target directory | |
| id: target | |
| run: | | |
| if [[ "${{ github.event_name }}" == "release" ]]; then | |
| echo "dir=$(echo '${{ github.event.release.tag_name }}')" >> $GITHUB_ENV | |
| else | |
| echo "dir=latest" >> $GITHUB_ENV | |
| fi | |
| - name: Deploy to gh-pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: gh-pages | |
| publish_dir: output | |
| destination_dir: validation/${{ env.dir }} | |
| # vim: expandtab tabstop=2 shiftwidth=2 |