-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (64 loc) · 2.8 KB
/
build_osi_field_checker.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
name: Build OSI Field Checker
on:
workflow_call:
jobs:
build_osi_field_checker_fmu:
name: Build OSI Field Checker
runs-on: ubuntu-latest
steps:
- name: Cache Protobuf
id: cache-protobuf
uses: actions/cache@v3
with:
path: protobuf-21.12
key: ${{ runner.os }}-protobuf
- name: Download ProtoBuf
if: steps.cache-protobuf.outputs.cache-hit != 'true'
run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protobuf-all-21.12.tar.gz && tar xzvf protobuf-all-21.12.tar.gz
- name: Build ProtoBuf
if: steps.cache-protobuf.outputs.cache-hit != 'true'
working-directory: protobuf-21.12
run: ./configure DIST_LANG=cpp --disable-shared CXXFLAGS="-fPIC" && make -j4
- name: Install ProtoBuf
working-directory: protobuf-21.12
run: sudo make install && sudo ldconfig
- name: Cache OSI Field Checker FMU
id: cache-osi-field-checker
uses: actions/cache@v3
with:
path: /tmp/osi-field-checker
key: ${{ runner.os }}-osi-field-checker
- name: Clone OpenMSL OSI Field Checker
if: steps.cache-osi-field-checker.outputs.cache-hit != 'true'
run: git clone https://github.com/openMSL/sl-5-2-osi-field-checker.git
- name: Prepare C++ Build
if: steps.cache-osi-field-checker.outputs.cache-hit != 'true'
working-directory: sl-5-2-osi-field-checker
run: git submodule update --init && mkdir build
- name: Configure CMake
if: steps.cache-osi-field-checker.outputs.cache-hit != 'true'
working-directory: sl-5-2-osi-field-checker/build
run: cmake -DCMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
- name: Build C++
if: steps.cache-osi-field-checker.outputs.cache-hit != 'true'
working-directory: sl-5-2-osi-field-checker/build
run: cmake --build . -j4
- name: Create FMU Directory
if: steps.cache-osi-field-checker.outputs.cache-hit != 'true'
working-directory: sl-5-2-osi-field-checker/build
run: mkdir /tmp/osi-field-checker
- name: Copy Commit ID to Cache
if: steps.cache-osi-field-checker.outputs.cache-hit != 'true'
working-directory: sl-5-2-osi-field-checker
run: |
git rev-parse --short HEAD > commit-id.txt
cp commit-id.txt /tmp/osi-field-checker/commit-id.txt
- name: Copy OSI Field Checker FMU
if: steps.cache-osi-field-checker.outputs.cache-hit != 'true'
working-directory: sl-5-2-osi-field-checker/build
run: cp OSIFieldChecker.fmu /tmp/osi-field-checker/OSIFieldChecker.fmu
- name: Commit ID
working-directory: /tmp/osi-field-checker
run: |
echo "Commit ID: "
echo $(cat commit-id.txt)