-
Notifications
You must be signed in to change notification settings - Fork 72
150 lines (129 loc) · 4.72 KB
/
Copy pathbuild_nilrt.yml
File metadata and controls
150 lines (129 loc) · 4.72 KB
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
name: NI Linux Real-Time Build
on:
workflow_call:
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
build-nilrt:
name: NILRT Cross Compile
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup python3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@v5
with:
version: 1.12.1
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.18.x'
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
# The URL used to download this toolchain may change in the future as
# improvements to hosting and exports of the NILRT toolchain are made.
- name: Install NI Linux RT CC Toolchain
run: |
wget -nv https://download.ni.com/support/softlib/labview/labview_rt/2023Q4/LinuxToolchains/linux/oecore-x86_64-core2-64-toolchain-10.0.sh
sudo chmod a+x ./oecore-x86_64-core2-64-toolchain-10.0.sh
sudo ./oecore-x86_64-core2-64-toolchain-10.0.sh -y -d $GITHUB_WORKSPACE/nilrt-toolchain/
echo "$GITHUB_WORKSPACE/nilrt-toolchain/sysroots/x86_64-nilrtsdk-linux/usr/bin/x86_64-nilrt-linux" >> $GITHUB_PATH
- name: Update Submodules
id: submodules
run: |
git submodule update --init --recursive
echo "grpc-commit=$(git rev-parse --short @:./third_party/grpc)" >> $GITHUB_OUTPUT
- name: Cache Host OS gRPC Support
uses: actions/cache@v4
id: hostgrpccache
env:
cache-name: hostgrpccache
with:
path: third_party/grpc/build/
key: ${{ github.repository }}-${{ runner.os }}-${{ env.cache-name }}-${{ steps.submodules.outputs.grpc-commit }}
- name: Configure Host OS gRPC Support
if: steps.hostgrpccache.outputs.cache-hit != 'true'
run: >
cmake
-S $GITHUB_WORKSPACE/third_party/grpc/
-B $GITHUB_WORKSPACE/third_party/grpc/build
-D CMAKE_BUILD_TYPE=$BUILD_TYPE
-D gRPC_INSTALL=ON
-D gRPC_BUILD_TESTS=OFF
-G "Ninja"
- name: Build Host OS gRPC Support
if: steps.hostgrpccache.outputs.cache-hit != 'true'
run: >
cmake
--build $GITHUB_WORKSPACE/third_party/grpc/build
-j ${{ steps.cpu-cores.outputs.count }}
- name: Install Host OS gRPC Support
run: sudo cmake --install $GITHUB_WORKSPACE/third_party/grpc/build
- name: Configure Cross Compile
run: >
cmake
-S .
-B build
-D CMAKE_BUILD_TYPE=$BUILD_TYPE
-D USE_NILRT_LEGACY_TOOLCHAIN=on
-G "Ninja"
- name: Cross Compile
run: >
cmake
--build build
-j ${{ steps.cpu-cores.outputs.count }}
# The generated source in git must match the output of workflow builds.
# If this step fails, something is changing during build. Either:
# 1. Fix non-deterministic codegen, OR
# 2. Build locally to ensure generated files are up-to-date.
- name: Check for files dirtied by codegen
run: git diff --exit-code
- name: Tar Server Build Files
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases') }}
run: >-
tar -cvzf ni-grpc-device-server-ni-linux-rt-x64.tar.gz
-C $GITHUB_WORKSPACE/build
ni_grpc_device_server
server_config.json
server_capabilities.json
server_nitlsconfig.json
ni-grpc-device.conf.yml
ni-grpc-device.caps.yml
-C $GITHUB_WORKSPACE
LICENSE
ThirdPartyNotices.txt
- name: Upload Server Artifact
uses: actions/upload-artifact@v4
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases') }}
with:
name: ni-grpc-device-server-ni-linux-rt-x64
path: ni-grpc-device-server-ni-linux-rt-x64.tar.gz
retention-days: 5
- name: Tar Test Build Files
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases') }}
run: >-
tar -cvzf ni-grpc-device-tests-ni-linux-rt-x64.tar.gz
-C $GITHUB_WORKSPACE/build
certs/
IntegrationTestsRunner
libTestApi.so
SystemTestsRunner
test_localhost_config.json
test_mutual_tls_config.json
UnitTestsRunner
-C $GITHUB_WORKSPACE
LICENSE
ThirdPartyNotices.txt
- name: Upload Tests Artifact
uses: actions/upload-artifact@v4
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases') }}
with:
name: ni-grpc-device-tests-ni-linux-rt-x64
path: ni-grpc-device-tests-ni-linux-rt-x64.tar.gz
retention-days: 5