-
Notifications
You must be signed in to change notification settings - Fork 13
56 lines (56 loc) · 2.3 KB
/
write_models.yaml
File metadata and controls
56 lines (56 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Write Models
run-name: Writing Models
on: [workflow_dispatch]
permissions:
contents: write
jobs:
Write-Models:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Building AmpTools
run: |
mkdir Tutorials/Dalitz/lib
mkdir Tutorials/Dalitz/bin
make
export AMPTOOLS_HOME=$(pwd)
echo "AMPTOOLS_HOME=$AMPTOOLS_HOME" >> $GITHUB_ENV
echo "AMPTOOLS=$AMPTOOLS_HOME/AmpTools" >> $GITHUB_ENV
echo "AMPPLOTTER=$AMPTOOLS_HOME/AmpPlotter" >> $GITHUB_ENV
echo "DALITZ=$AMPTOOLS_HOME/Tutorials/Dalitz" >> $GITHUB_ENV
echo "UNIT_TESTS=$AMPTOOLS_HOME/UnitTests" >> $GITHUB_ENV
- name: Generating files
run: |
cd $UNIT_TESTS
$DALITZ/bin/generatePhaseSpace phasespace.gen.root 100000 12345
$DALITZ/bin/toyAcceptance phasespace.gen.root phasespace.acc.root 12345
$DALITZ/bin/generatePhysics parserTest.cfg physics.gen.root 100000 12345
$DALITZ/bin/toyAcceptance physics.gen.root physics.acc.root 12345
$DALITZ/bin/fitAmplitudes parserTest.cfg
- name: Writing Models
run: |
cd $UNIT_TESTS
if [ ! -d "models" ]; then
mkdir -p "models"
fi
./writeModels
- name: Commit Changes
id: commit_changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "github-actions"
cd $UNIT_TESTS
git add models/
if git diff --cached --quiet; then
echo "No changes to commit."
echo "push_required=false" >> $GITHUB_OUTPUT
else
git commit -m "Updated models"
echo "push_required=true" >> $GITHUB_OUTPUT
fi
- name: Push changes
if: steps.commit_changes.outputs.push_required == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}