-
Notifications
You must be signed in to change notification settings - Fork 12
135 lines (117 loc) · 3.92 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
130
131
132
133
134
135
# SPDX-FileCopyrightText: 2024 OGL authors
#
# SPDX-License-Identifier: GPL-3.0-or-later
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:
USER: user
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@v4
- 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) }}
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@v4
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip-cache')}}
with:
key: build_PR_${{ github.event.pull_request.number }}_${{matrix.OF.path}}
path: ${{github.workspace}}/build
- name: Cache FOAM_USER_LIBBIN
uses: actions/cache@v4
with:
key: FOAM_USER_LIBBIN-${{ matrix.OF.path }}-${{ 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}}
cmake --preset develop
- name: Build OGL
working-directory: ${{github.workspace}}
run: |
source /root/OpenFOAM/${{matrix.OF.path}}/etc/bashrc
cmake --build --preset develop
- name: Install OGL
working-directory: ${{github.workspace}}
run: |
source /root/OpenFOAM/${{matrix.OF.path}}/etc/bashrc
cmake --build --preset develop --target install
- name: Check folders
working-directory: ${{github.workspace}}
run: |
echo "check build folder"
ls ./build
echo "check libbin folder ${{matrix.OF.foam_user_libbin}}"
ls ${{matrix.OF.foam_user_libbin}}
- name: Archive production artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: ogl_build_${{ matrix.OF.path }}
path: ${{github.workspace}}/build
unit_tests:
needs: [build, setup_build_matrix]
uses: ./.github/workflows/unit-test.yml
with:
path: ${{ matrix.OF.path }}
version: ${{ matrix.OF.version }}
foam_user_libbin: ${{ matrix.OF.foam_user_libbin }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }}
integration_tests:
needs: [build, 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) }}