forked from precice/openfoam-adapter
-
-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (162 loc) · 5.9 KB
/
build-custom.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
159
160
161
162
163
name: Custom build (manual) # Unfortunately, we cannot modify the name: https://github.community/t/github-actions-dynamic-name-of-the-workflow-with-workflow-dispatch/150327
on:
workflow_dispatch:
inputs:
virtualEnvironment:
description: 'Virtual Environment'
default: 'ubuntu-18.04'
required: true
type: choice
options:
- ubuntu-22.04
- ubuntu-20.04
- ubuntu-18.04
refAdapter:
description: 'Ref (branch/tag/commit) of the OpenFOAM adapter to build'
default: 'develop'
required: true
versionOpenFOAM:
description: 'Version of OpenFOAM to build with'
required: true
type: choice
options:
- 2406
- 2312
- 2306
- 2212
- 2206
- 2112
- 2106
- 2012
- 2006
- 1912
- 10
- 9
- 8
- 7
- 6
- 5
versionpreCICE:
description: 'Version of preCICE to build with'
default: 'v3.0.0'
required: true
runTutorialHeatedPlate:
description: Run tutorial flow-over-heated-plate
type: boolean
default: true
required: true
runTutorialQuickstart:
description: Run tutorial quickstart
type: boolean
default: true
required: true
runTutorialPartitionedPipe:
description: Run tutorial partitioned-pipe
type: boolean
default: true
required: true
branchTutorials:
description: 'Branch of the tutorials to use'
default: 'master'
required: true
jobs:
build:
runs-on: ${{ github.event.inputs.virtualEnvironment }}
steps:
- name: Report log
run: |
echo "Initiated by: ${{ github.actor }}"
echo "Runs on: ${{ github.event.inputs.virtualEnvironment }}"
echo "Adapter ref (branch/tag/commit): ${{ github.event.inputs.refAdapter }}"
echo "OpenFOAM version: ${{ github.event.inputs.versionOpenFOAM }}"
echo "preCICE version: ${{ github.event.inputs.versionpreCICE }}"
echo "Run tutorial flow-over-heated-plate: ${{ github.event.inputs.runTutorialHeatedPlate }}"
echo "Run tutorial quickstart: ${{ github.event.inputs.runTutorialQuickstart }}"
echo "Run tutorial partitioned-pipe: ${{ github.event.inputs.runTutorialPartitionedPipe }}"
echo "Tutorials branch: ${{ github.event.inputs.branchTutorials }}"
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.refAdapter }}
- name: Install preCICE (no cache)
uses: precice/setup-precice-action@main
with:
precice-version: ${{ github.event.inputs.versionpreCICE }}
- name: Set up OpenFOAM
uses: gerlero/setup-openfoam@v1
with:
openfoam-version: ${{ github.event.inputs.versionOpenFOAM }}
- name: Build OpenFOAM-preCICE adapter
run: |
./Allwmake
- name: Get tutorials
run: |
git clone https://github.com/precice/tutorials.git --branch ${{ github.event.inputs.branchTutorials }} --depth 1
- name: Run tutorial flow-over-heated-plate
run: |
if ${{ github.event.inputs.runTutorialHeatedPlate }}
then
cd tutorials/flow-over-heated-plate/fluid-openfoam
./run.sh | tee fluid-openfoam.log 2>&1 &
PIDfluid=$!
cd ../solid-openfoam
./run.sh | tee solid-openfoam.log 2>&1
wait $PIDfluid
fi
- name: Run tutorial quickstart
run: |
if ${{ github.event.inputs.runTutorialQuickstart }}
then
cd tutorials/quickstart/fluid-openfoam
if [ "${{ github.event.inputs.versionOpenFOAM }}" == 5 ]
then
echo "Manually changing from pimpleFoam to pimpleDyMFoam for compatibility with OpenFOAM 5."
sed -i 's/pimpleFoam/pimpleDyMFoam/g' system/controlDict
fi
if [ "${{ github.event.inputs.versionOpenFOAM }}" == 9 ]
then
echo "Manually changing from solver to motionSolver in dynamicMeshDict for compatibility with OpenFOAM 9."
sed -i 's/solver/motionSolver/g' constant/dynamicMeshDict
fi
./run.sh | tee fluid-openfoam.log 2>&1 &
PIDfluid=$!
cd ../solid-cpp
cmake . && make && ./run.sh | tee solid-cpp.log 2>&1
wait $PIDfluid
fi
- name: Run tutorial partitioned-pipe
run: |
if ${{ github.event.inputs.runTutorialPartitionedPipe }}
then
cd tutorials/partitioned-pipe/fluid1-openfoam-pimplefoam
./run.sh | tee fluid1-openfoam-pimplefoam.log 2>&1 &
PIDfluid=$!
cd ../fluid2-openfoam-pimplefoam
./run.sh | tee fluid2-openfoam-pimplefoam.log 2>&1 &
wait $PIDfluid
fi
- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: logs
path: |
Allwmake.log
wmake.log
ldd.log
tutorials/flow-over-heated-plate/fluid-openfoam/fluid-openfoam.log
tutorials/flow-over-heated-plate/solid-openfoam/solid-openfoam.log
tutorials/quickstart/fluid-openfoam/fluid-openfoam.log
tutorials/quickstart/solid-cpp/solid-cpp.log
tutorials/partitioned-pipe/fluid1-openfoam-pimplefoam/fluid1-openfoam-pimplefoam.log
tutorials/partitioned-pipe/fluid2-openfoam-pimplefoam/fluid2-openfoam-pimplefoam.log
- name: Archive case files
uses: actions/upload-artifact@v4
with:
name: case-files
path: |
tutorials/flow-over-heated-plate/fluid-openfoam/*
tutorials/flow-over-heated-plate/solid-openfoam/*
tutorials/quickstart/fluid-openfoam/*
tutorials/quickstart/solid-cpp/*
tutorials/partitioned-pipe/fluid1-openfoam-pimplefoam/*
tutorials/partitioned-pipe/fluid2-openfoam-pimplefoam/*