Skip to content

TMS TF final design #257

TMS TF final design

TMS TF final design #257

Workflow file for this run

name: Automated tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
pull-requests: write
jobs:
check_changelog:
name: Check that CHANGELOG was updated
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check CHANGELOG diff
run: |
if git diff --exit-code origin/${{github.base_ref}} -- CHANGELOG.md
then
echo "::error file=CHANGELOG.md::CHANGELOG was not updated"
exit 1
else
echo "::notice file=CHANGELOG.md::CHANGELOG was updated"
fi
build:
name: Build default geometry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # We need the full history for the git metadata
- name: Setup
run: pip install .
- name: Build defaul gdml
run: make -j $(nproc)
- name: Upload default geometry
uses: actions/upload-artifact@v4
with:
name: Default Geometry
path: "*.gdml"
if-no-files-found: error
check_overlaps:
name: Check geometry for overlaps
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Install ROOT
run: sudo snap install root-framework
- name: Download default geometry
uses: actions/download-artifact@v4
with:
name: Default Geometry
- name: Debug artifact
run: |
ls -l
head *.gdml
- name: Run standard overlap check
run: |
for F in *.gdml
do
root -q -b "checkOverlaps.C(\"${F}\", 0)" 2>&1 | tee check.log
grep "Number of illegal overlaps/extrusions : 0" check.log
done
- name: Run sampling overlap check
run: |
for F in *.gdml
do
root -q -b "checkOverlaps.C(\"${F}\", 1)" 2>&1 | tee check.log
grep "Number of illegal overlaps/extrusions : 0" check.log
done
put_online:
name: Put geometries online for visual inspection
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Install ROOT
run: sudo snap install root-framework
- name: Download default geometry
uses: actions/download-artifact@v4
with:
name: Default Geometry
- name: Convert gdml files to root
run: |
for F in *.gdml
do
root "gdml2root.C(\"$F\", \"jsroot/${F%.gdml}.root\")"
done
- name: Replace heading in html
run: |
sed -i -e "s|master|$GITHUB_REF_NAME|" jsroot/index.htm
sed -i -e "s|master|$GITHUB_REF_NAME|" jsroot/static.htm
- name: Create static images
run: |
sed -i -e "s|<li>image</li>|$LISTITEMS|" jsroot/static.htm
LISTITEMS=""
for F in *.gdml
do
cd scripts
OUTDIR=../jsroot/plots_$F
mkdir -p $OUTDIR
./draw_all.sh --filename ../$F --outdir $OUTDIR
for OF in $OUTDIR/*.png
do
LISTITEMS="$LISTITEMS <tr><td>${OF#../jsroot/}<br/><img src=\"${OF#../jsroot/}\" /></td></tr>"
done
cd ..
done
sed -i -e "s|<tr><td>image</td></tr>|$LISTITEMS|" jsroot/static.htm
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload jsroot folder
path: 'jsroot'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Post link in PR
if: github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v3
with:
message: |
Geometry is ready for visual inspection at https://dune.github.io/dunendggd/
comment-tag: geoview