-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (52 loc) · 1.71 KB
/
build.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
name: Build
on:
workflow_call:
jobs:
build:
name: Build FMU
runs-on: ubuntu-latest
steps:
- name: Checkout Model
uses: actions/checkout@v3
with:
submodules: true
- 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
- name: Install ProtoBuf
working-directory: protobuf-21.12
run: sudo make install && sudo ldconfig
- name: Prepare C++ Build
run: mkdir build
- name: Configure CMake
working-directory: build
run: cmake -DCMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
- name: Build C++
working-directory: build
run: cmake --build .
- name: Create FMU Directory
working-directory: build
run: mkdir /tmp/model_fmu
- name: Copy Model FMU
working-directory: build
run: cp ${{ github.event.repository.name }}.fmu /tmp/model_fmu/${{ github.event.repository.name }}.fmu
- name: Cache Model FMU
id: cache-model-fmu
uses: actions/cache@v3
with:
path: /tmp/model_fmu
key: ${{ runner.os }}-model-fmu-${{ github.sha }}
- name: Commit ID
run: |
echo "Commit ID: "
echo $(git rev-parse --short HEAD)