-
Notifications
You must be signed in to change notification settings - Fork 6
218 lines (196 loc) · 6.53 KB
/
build.yml
File metadata and controls
218 lines (196 loc) · 6.53 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Build and Package
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build-native:
name: Build Native Library - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact-name: linux-x64
lib-name: libiceoryx2_ffi_c.so
- os: macos-latest
artifact-name: osx-x64
lib-name: libiceoryx2_ffi_c.dylib
- os: windows-latest
artifact-name: win-x64
lib-name: iceoryx2_ffi_c.dll
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev clang
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
iceoryx2/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('iceoryx2/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build iceoryx2 C FFI library (Unix)
if: runner.os != 'Windows'
working-directory: iceoryx2
run: cargo build --release --package iceoryx2-ffi-c
- name: Build iceoryx2 C FFI library (Windows)
if: runner.os == 'Windows'
working-directory: iceoryx2
run: cargo build --release --package iceoryx2-ffi-c
- name: Upload native library artifact
uses: actions/upload-artifact@v4
with:
name: native-${{ matrix.artifact-name }}
path: iceoryx2/target/release/${{ matrix.lib-name }}
if-no-files-found: error
build-dotnet:
name: Build .NET Library
needs: build-native
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Download all native libraries
uses: actions/download-artifact@v4
with:
path: native-libs
- name: Copy native libraries to target directory
run: |
mkdir -p iceoryx2/target/release
cp native-libs/native-linux-x64/libiceoryx2_ffi_c.so iceoryx2/target/release/ || true
cp native-libs/native-osx-x64/libiceoryx2_ffi_c.dylib iceoryx2/target/release/ || true
cp native-libs/native-win-x64/iceoryx2_ffi_c.dll iceoryx2/target/release/ || true
ls -la iceoryx2/target/release/
- name: Restore .NET dependencies
run: dotnet restore
- name: Verify Code Formatting
run: dotnet format --verify-no-changes --verbosity diagnostic
- name: Build .NET solution
run: dotnet build --configuration Release --no-restore
- name: Run tests
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dotnet-build
path: |
src/Iceoryx2/bin/Release/
src/Iceoryx2.Reactive/bin/Release/
# NOTE: NuGet package creation is temporarily disabled.
# Will be supported soon.
#
# create-nuget-package:
# name: Create NuGet Packages
# needs: build-dotnet
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# submodules: recursive
#
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: |
# 8.0.x
# 9.0.x
#
# - name: Download all native libraries
# uses: actions/download-artifact@v4
# with:
# path: native-libs
#
# - name: Copy native libraries to target directory
# run: |
# mkdir -p iceoryx2/target/release
# cp native-libs/native-linux-x64/libiceoryx2_ffi_c.so iceoryx2/target/release/ || true
# cp native-libs/native-osx-x64/libiceoryx2_ffi_c.dylib iceoryx2/target/release/ || true
# cp native-libs/native-win-x64/iceoryx2_ffi_c.dll iceoryx2/target/release/ || true
# ls -la iceoryx2/target/release/
#
# - name: Create NuGet package - Iceoryx2
# run: dotnet pack src/Iceoryx2/Iceoryx2.csproj --configuration Release --output ./nupkgs
#
# - name: Create NuGet package - Iceoryx2.Reactive
# run: dotnet pack src/Iceoryx2.Reactive/Iceoryx2.Reactive.csproj --configuration Release --output ./nupkgs
#
# - name: List NuGet packages
# run: ls -lh ./nupkgs/
#
# - name: Upload NuGet packages
# uses: actions/upload-artifact@v4
# with:
# name: nuget-packages
# path: nupkgs/*.nupkg
# if-no-files-found: error
# NOTE: NuGet publishing is disabled until Eclipse formal review process
# for binary releases is completed. The packages are still built and
# available as artifacts. To re-enable, uncomment this job and add
# NUGET_API_KEY secret to the repository.
#
# publish-nuget:
# name: Publish to NuGet (on tag)
# needs: create-nuget-package
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
#
# steps:
# - name: Download NuGet packages
# uses: actions/download-artifact@v4
# with:
# name: nuget-packages
# path: nupkgs
#
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 8.0.x
#
# - name: Publish to NuGet.org
# run: |
# dotnet nuget push nupkgs/*.nupkg \
# --api-key ${{ secrets.NUGET_API_KEY }} \
# --source https://api.nuget.org/v3/index.json \
# --skip-duplicate
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: markdownlint-cli2-action
uses: DavidAnson/markdownlint-cli2-action@v20
with:
config: .markdownlint.yaml
globs: |
README.md