-
Notifications
You must be signed in to change notification settings - Fork 12
129 lines (112 loc) · 3.68 KB
/
build-foam.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
name: Build OpenFOAM (ESI|FOUNDATION)
run-name: 'Build and integration'
defaults:
run:
shell: bash -o pipefail -i {0}
on:
push:
branches:
- dev
- main
pull_request:
types: synchronize
schedule:
- cron: "* 0 * * 0"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BUILD_TYPE: Release
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
jobs:
setup_build_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout to repository
uses: actions/checkout@v3
- name: Set matrix data
id: set-matrix
run: |
pwd
echo "matrix=$(jq -c . < .github/workflows/test_matrix.json)" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
container: greole/ofbase
needs: setup_build_matrix
name: build-${{matrix.OF.version}}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }}
# {
# version: "5.0",
# fork: "extend",
# path: "foam-extend-5.0",
# repo: "git://git.code.sf.net/p/foam-extend/foam-extend-5.0"
# }
steps:
- uses: actions/checkout@v4
- name: Get Ginkgo checkout version
shell: bash
run: |
grep -A1 "set(GINKGO_CHECKOUT_VERSION" CMakeLists.txt|tail -n1|grep -o "[0-9a-z\-]*" > GINKGO_CHECKOUT_VERSION
export GINKGO_CHECKOUT_VERSION=$(cat GINKGO_CHECKOUT_VERSION)
echo "GINKGO_CHECKOUT_VERSION=$GINKGO_CHECKOUT_VERSION" >> $GITHUB_ENV
- name: Cache build folder
uses: actions/cache@v3
with:
key: build-${{ matrix.OF.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
path: |
${{github.workspace}}/build
- name: Cache FOAM_USER_LIBBIN
uses: actions/cache@v3
with:
key: FOAM_USER_LIBBIN-${{ matrix.OF.version }}-${{ github.sha }}
path: |
${{matrix.OF.foam_user_libbin}}
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
working-directory: ${{github.workspace}}
run: |
source /root/OpenFOAM/${{matrix.OF.path}}/etc/bashrc
mkdir -p ${{matrix.OF.foam_user_libbin}}
mkdir -p build
cd build
[ -d "/github/home/$GINKGO_CHECKOUT_VERSION" ] && cp -rp /github/home/$GINKGO_CHECKOUT_VERSION third_party
cmake -G Ninja -DOGL_ALLOW_REFERENCE_ONLY=On -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
- name: Build OGL
working-directory: ${{github.workspace}}/build
run: |
cmake --build . --config $BUILD_TYPE
- name: Install OGL
working-directory: ${{github.workspace}}
run: |
cmake --install ./build
- name: Check folders
working-directory: ${{github.workspace}}
run: |
ls ./build
ls ${{matrix.OF.foam_user_libbin}}
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: ogl_build_${{ matrix.OF.path }}
path: ${{github.workspace}}/build
unit_tests:
needs: [build, setup_build_matrix]
uses: ./.github/workflows/unit-tests.yml
integration_tests:
needs: [build, unit_tests, setup_build_matrix]
uses: ./.github/workflows/integration-tests.yml
with:
path: ${{ matrix.OF.path }}
version: ${{ matrix.OF.version }}
cyclic_case: ${{ matrix.OF.cyclic_case }}
foam_user_libbin: ${{ matrix.OF.foam_user_libbin }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }}