Skip to content

Commit 72b0568

Browse files
authored
Merge pull request #96 from rest-for-physics/submodule-validation
Separating framework and rawlib validation in different files
2 parents f403fce + c0275c2 commit 72b0568

File tree

2 files changed

+67
-25
lines changed

2 files changed

+67
-25
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Framework Validation
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
release:
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
env:
14+
CMAKE_BUILD_TYPE: Release
15+
REST_PATH: /rest/rawlib/install
16+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
framework-validation:
24+
uses: rest-for-physics/framework/.github/workflows/validation.yml@submodule-validation

.github/workflows/validation.yml

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,62 @@
11
name: Validation
22

33
on:
4-
push:
5-
branches: [ "master" ]
6-
pull_request:
7-
branches: [ "master" ]
8-
release:
9-
104
workflow_dispatch:
5+
workflow_call:
116

127
env:
138
CMAKE_BUILD_TYPE: Release
149
REST_PATH: /rest/rawlib/install
10+
RAW_LIB_PATH: rawlib
1511
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
1612

1713
defaults:
1814
run:
1915
shell: bash
2016

2117
jobs:
22-
framework-validation:
23-
uses: rest-for-physics/framework/.github/workflows/validation.yml@master
2418

2519
libCheck:
2620
name: Validate library
2721
runs-on: ubuntu-latest
2822
container:
2923
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
3024
steps:
31-
- uses: actions/checkout@v3
32-
- run: python3 pipeline/validateLibrary.py .
25+
- uses: rest-for-physics/framework/.github/actions/checkout@submodule-validation
26+
with:
27+
branch: ${{ env.BRANCH_NAME }}
28+
repository: rest-for-physics/rawlib
29+
path: ${{ env.RAW_LIB_PATH }}
30+
- run: python3 ${{ env.RAW_LIB_PATH }}/pipeline/validateLibrary.py .
31+
32+
precommit-config:
33+
name: Validate pre-commit config
34+
runs-on: ubuntu-latest
35+
container:
36+
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
37+
steps:
38+
- name: Checkout rawlib
39+
uses: rest-for-physics/framework/.github/actions/checkout@submodule-validation
40+
with:
41+
branch: ${{ env.BRANCH_NAME }}
42+
repository: rest-for-physics/rawlib
43+
path: ${{ env.RAW_LIB_PATH }}
44+
- name: Verify pre-commit config files match
45+
run: |
46+
cd ${{ env.RAW_LIB_PATH }}
47+
curl https://raw.githubusercontent.com/rest-for-physics/framework/master/scripts/validatePreCommitConfig.py | python
3348
3449
build-rawlib:
3550
name: Build only rawlib
3651
runs-on: ubuntu-latest
3752
container:
3853
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
3954
steps:
40-
- uses: actions/checkout@v3
4155
- name: Build and install
4256
uses: rest-for-physics/framework/.github/actions/build@master
4357
with:
4458
cmake-flags: "-DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DRESTLIB_RAW=ON"
4559
branch: ${{ env.BRANCH_NAME }}
46-
- name: Verify pre-commit config files match
47-
run: |
48-
cd $GITHUB_WORKSPACE
49-
curl https://raw.githubusercontent.com/rest-for-physics/framework/master/scripts/validatePreCommitConfig.py | python
5060
- name: Cache framework installation
5161
id: rawlib-install-cache
5262
uses: actions/cache@v3
@@ -61,7 +71,11 @@ jobs:
6171
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
6272
needs: [ build-rawlib ]
6373
steps:
64-
- uses: actions/checkout@v3
74+
- uses: rest-for-physics/framework/.github/actions/checkout@submodule-validation
75+
with:
76+
branch: ${{ env.BRANCH_NAME }}
77+
repository: rest-for-physics/rawlib
78+
path: ${{ env.RAW_LIB_PATH }}
6579
- name: Restore cache
6680
uses: actions/cache@v3
6781
id: rawlib-install-cache
@@ -71,38 +85,38 @@ jobs:
7185
- name: Add signal noise
7286
run: |
7387
source ${{ env.REST_PATH }}/thisREST.sh
74-
cd pipeline/processes/noise
88+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/noise
7589
python addNoise.py
7690
- name: Common Noise
7791
run: |
7892
source ${{ env.REST_PATH }}/thisREST.sh
79-
cd pipeline/processes/commonNoise
93+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/commonNoise
8094
restRoot -b -q commonNoise.C
8195
- name: Veto Analysis
8296
run: |
8397
source ${{ env.REST_PATH }}/thisREST.sh
84-
cd pipeline/processes/veto
98+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/veto
8599
restManager --c veto.rml --f ../../data/R01208_Ar2Iso_Background14h_14Vetos_IccubFEC-000.aqs
86100
python vetoValidation.py
87101
- name: Signal Shaping
88102
run: |
89103
source ${{ env.REST_PATH }}/thisREST.sh
90-
cd pipeline/processes/shaping
104+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/shaping
91105
restRoot -b -q shaping.C
92106
- name: Fitting Process
93107
run: |
94108
source ${{ env.REST_PATH }}/thisREST.sh
95-
cd pipeline/processes/fit
109+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/fit
96110
restRoot -b -q fit.C
97111
- name: General Fit Process
98112
run: |
99113
source ${{ env.REST_PATH }}/thisREST.sh
100-
cd pipeline/processes/fit
114+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/fit
101115
restRoot -b -q GeneralFit.C
102116
- name: Analysis Process
103117
run: |
104118
source ${{ env.REST_PATH }}/thisREST.sh
105-
cd pipeline/processes/analysis
119+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/analysis
106120
restManager --c veto.rml --f ../../data/R01208_Ar2Iso_Background14h_14Vetos_IccubFEC-000.aqs
107121
restRoot -b -q validate.C
108122
@@ -113,7 +127,11 @@ jobs:
113127
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
114128
needs: [ build-rawlib ]
115129
steps:
116-
- uses: actions/checkout@v3
130+
- uses: rest-for-physics/framework/.github/actions/checkout@submodule-validation
131+
with:
132+
branch: ${{ env.BRANCH_NAME }}
133+
repository: rest-for-physics/rawlib
134+
path: ${{ env.RAW_LIB_PATH }}
117135
- name: Restore cache
118136
uses: actions/cache@v3
119137
id: rawlib-install-cache
@@ -123,6 +141,6 @@ jobs:
123141
- name: Dream data
124142
run: |
125143
source ${{ env.REST_PATH }}/thisREST.sh
126-
cd pipeline/external/dream
144+
cd ${{ env.RAW_LIB_PATH }}/pipeline/external/dream
127145
restManager --c dream.rml --f dummyDreamData.fdf
128146
restRoot -b -q dream.C

0 commit comments

Comments
 (0)