forked from madgraph5/madgraph4gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (132 loc) · 6.56 KB
/
testsuite_oneprocess.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Copyright (C) 2020-2023 CERN and UCLouvain.
# Licensed under the GNU Lesser General Public License (version 3 or later).
# Created by: A. Valassi (Oct 2023) for the MG5aMC CUDACPP plugin.
# Further modified by: A. Valassi (2023) for the MG5aMC CUDACPP plugin.
#----------------------------------------------------------------------------------------------------------------------------------
name: Test one process
#----------------------------------------------------------------------------------------------------------------------------------
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#run-name
run-name: Manually test one process ${{ inputs.process }} (enableFPE = ${{ inputs.enableFPE }})
#----------------------------------------------------------------------------------------------------------------------------------
on:
# Trigger the one-process workflow from the all-processes workflow
# See https://stackoverflow.com/a/75337311
workflow_call:
inputs:
process: # this variable is provided by the matrix in testsuite_allprocesses.yml
required: true
type: string
# Manually trigger the one-process workflow
# (the lines below are adapted rom the default github manual workflow example)
workflow_dispatch:
inputs:
process:
description: 'Physics process'
default: 'gg_tt.mad'
required: true
###type: string
type: choice
# FIXME? Can the list of supported processes be specified only once in oneprocess.yml or allprocesses.yml?
options: [gg_tt.mad, gg_ttg.mad, gg_ttgg.mad, gg_ttggg.mad, ee_mumu.mad]
enableFPE:
description: 'Enable FPE tests?'
default: true
required: true
type: boolean
#----------------------------------------------------------------------------------------------------------------------------------
jobs:
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
cleanup:
###if: ${{ false }} # disable the job (comment this out to enable it!)
runs-on: ubuntu-latest
permissions:
actions: write # this is required to delete caches
contents: read
steps:
- name: cleanup_cache
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
echo "List cache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc --key cache-${{ runner.os }}-${{ inputs.process }}
echo "List cache keys (end)"
###cacheKeys=$(gh actions-cache list -R $REPO --sort created-at --order asc --key cache-${{ runner.os }}-${{ inputs.process }} | cut -f 1) # delete ALL caches
cacheKeys=$(gh actions-cache list -R $REPO --sort created-at --order asc --key cache-${{ runner.os }}-${{ inputs.process }} | cut -f 1 | head --lines=-1) # keep only the most recent cache
set +e # do not fail while deleting cache keys
echo "Deleting caches..."
for cacheKey in $cacheKeys; do gh actions-cache delete $cacheKey -R $REPO --confirm; done
echo "Deleting caches... done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testsuite:
runs-on: ubuntu-latest
needs: cleanup
steps:
- # See https://github.com/actions/checkout
# (NB actions/checkout needs "Allow owner and select non-owner" and "Allow actions created by github")
uses: actions/checkout@v4
with:
submodules: 'true'
- name: HELLO
run: |
echo "HELLO ${{ inputs.process }}! $(date)"
echo "Current directory is $(pwd)"
echo "Current git commit is $(git log --oneline -n1 | cut -d' ' -f1)"
# See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
echo "List cache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc --key cache-${{ runner.os }}-${{ inputs.process }}
echo "List cache keys (end)"
env:
GH_TOKEN: ${{ github.token }}
- name: restore_cache
id: cache-restore
# See https://github.com/actions/cache
# See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
uses: actions/cache/restore@v3
with:
path: |
CCACHE_DIR
DOWNLOADS
test/googletest
key: cache-${{ runner.os }}-${{ inputs.process }}-${{ github.run_id }}
restore-keys:
cache-${{ runner.os }}-${{ inputs.process }}
- name: codegen
run: .github/workflows/testsuite_oneprocess.sh codegen ${{ inputs.process }}
- name: before_build
run: .github/workflows/testsuite_oneprocess.sh before_build ${{ inputs.process }}
- name: build
run: .github/workflows/testsuite_oneprocess.sh build ${{ inputs.process }}
- name: after_build
run: .github/workflows/testsuite_oneprocess.sh after_build ${{ inputs.process }}
- name: update_cache # update caches after the builds but before the tests (which may fail even if builds succeed)
id: cache-update
# See https://github.com/actions/cache
uses: actions/cache/save@v3
with:
path: |
CCACHE_DIR
DOWNLOADS
test/googletest
key: cache-${{ runner.os }}-${{ inputs.process }}-${{ github.run_id }}
- name: tput_test
run: .github/workflows/testsuite_oneprocess.sh tput_test ${{ inputs.process }}
- name: tput_test_fpe
run: .github/workflows/testsuite_oneprocess.sh tput_test_fpe ${{ inputs.process }}
if: ${{ inputs.enableFPE }}
- name: GOODBYE
run: |
echo "GOODBYE ${{ inputs.process }}! $(date)"
echo "Current directory is $(pwd)"
echo "Current git commit is $(git log --oneline -n1 | cut -d' ' -f1)"
REPO=${{ github.repository }}
echo "List cache keys (start)"
gh actions-cache list -R $REPO --sort created-at --order asc --key cache-${{ runner.os }}-${{ inputs.process }}
echo "List cache keys (end)"
env:
GH_TOKEN: ${{ github.token }}
#----------------------------------------------------------------------------------------------------------------------------------