Skip to content

Commit 53a28b3

Browse files
committed
refactor(ci): Simplify library download and path setup in CI workflow
1 parent 8a408a3 commit 53a28b3

File tree

1 file changed

+9
-66
lines changed

1 file changed

+9
-66
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -42,45 +42,11 @@ jobs:
4242
4343
- name: Download RTI Connector libraries
4444
run: |
45-
# Download libraries - specify platform explicitly to avoid misdetection
46-
if [ "$RUNNER_OS" == "Linux" ]; then
47-
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -platform linux-x64
48-
elif [ "$RUNNER_OS" == "Windows" ]; then
49-
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -platform win-x64
50-
else
51-
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest
52-
fi
53-
echo "Listing rticonnextdds-connector directory structure:"
54-
find rticonnextdds-connector -type f 2>/dev/null | head -30 || dir rticonnextdds-connector /s 2>nul || echo "Directory listing failed"
55-
# Fix nested directory issue if present
56-
if [ -d "rticonnextdds-connector/rticonnextdds-connector" ]; then
57-
echo "Fixing nested directory structure..."
58-
mv rticonnextdds-connector/rticonnextdds-connector/* rticonnextdds-connector/
59-
rmdir rticonnextdds-connector/rticonnextdds-connector
60-
echo "Fixed directory structure:"
61-
find rticonnextdds-connector -type f 2>/dev/null | head -30
62-
fi
45+
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest
46+
echo "Library files:"
47+
find rticonnextdds-connector -type f 2>/dev/null || dir rticonnextdds-connector /s
6348
shell: bash
6449

65-
- name: Verify library installation (Linux)
66-
if: runner.os == 'Linux'
67-
run: |
68-
echo "Full directory structure:"
69-
find rticonnextdds-connector -type f 2>/dev/null | head -50
70-
echo ""
71-
echo "Looking for .so files:"
72-
find rticonnextdds-connector -name "*.so*" 2>/dev/null || echo "No .so files found"
73-
74-
- name: Verify library installation (Windows)
75-
if: runner.os == 'Windows'
76-
run: |
77-
Write-Host "Full directory structure:"
78-
Get-ChildItem -Recurse rticonnextdds-connector | Select-Object FullName | Select-Object -First 50
79-
Write-Host ""
80-
Write-Host "Looking for .dll files:"
81-
Get-ChildItem -Recurse rticonnextdds-connector -Include "*.dll" | Select-Object FullName
82-
shell: powershell
83-
8450
- name: Install dependencies
8551
run: |
8652
go get -v -t -d ./...
@@ -89,39 +55,16 @@ jobs:
8955
- name: Set library path (Linux)
9056
if: runner.os == 'Linux'
9157
run: |
92-
# Find the directory containing .so files (avoid broken pipe with different approach)
93-
LIB_DIR=$(find rticonnextdds-connector -name "librtiddsconnector.so" -type f 2>/dev/null | head -1 | xargs -r dirname)
94-
if [ -z "$LIB_DIR" ]; then
95-
echo "ERROR: Could not find librtiddsconnector.so"
96-
echo "Directory structure:"
97-
find rticonnextdds-connector -type f
98-
exit 1
99-
fi
100-
echo "Found library directory: $LIB_DIR"
101-
# Use absolute path
102-
ABS_LIB_DIR=$(cd "$LIB_DIR" && pwd)
103-
echo "Absolute path: $ABS_LIB_DIR"
104-
echo "LD_LIBRARY_PATH=$ABS_LIB_DIR:$LD_LIBRARY_PATH" >> $GITHUB_ENV
105-
# Verify the library exists
106-
ls -la "$ABS_LIB_DIR"/librtiddsconnector.so*
58+
echo "LD_LIBRARY_PATH=$(pwd)/rticonnextdds-connector/lib/linux-x64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
59+
ls -la rticonnextdds-connector/lib/linux-x64/
10760
10861
- name: Set library path (Windows)
10962
if: runner.os == 'Windows'
11063
run: |
111-
# Find the directory containing .dll files
112-
$dllFile = Get-ChildItem -Recurse rticonnextdds-connector -Filter "rtiddsconnector.dll" | Select-Object -First 1
113-
if ($dllFile) {
114-
$libPath = $dllFile.DirectoryName
115-
Write-Host "Found library directory: $libPath"
116-
Write-Host "Verifying library exists:"
117-
Get-ChildItem $libPath -Filter "*.dll"
118-
echo "PATH=$libPath;$env:PATH" >> $env:GITHUB_ENV
119-
} else {
120-
Write-Host "ERROR: Could not find rtiddsconnector.dll"
121-
Write-Host "Directory structure:"
122-
Get-ChildItem -Recurse rticonnextdds-connector
123-
exit 1
124-
}
64+
$libPath = Join-Path $PWD "rticonnextdds-connector\lib\win-x64"
65+
Write-Host "Library path: $libPath"
66+
Get-ChildItem $libPath
67+
echo "PATH=$libPath;$env:PATH" >> $env:GITHUB_ENV
12568
shell: powershell
12669

12770
- name: Build Telegraf (Unix)

0 commit comments

Comments
 (0)