Skip to content

Commit 49c56d7

Browse files
authored
Make ci scripts more robust (#4608)
* Remove syntax error in release script * Make ci scripts more robust * Remove lib copying * Add bin directory to RPATH
1 parent cc86174 commit 49c56d7

File tree

5 files changed

+28
-27
lines changed

5 files changed

+28
-27
lines changed

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ jobs:
9090
# Configure, pointing to our just-generated slang-llvm archive
9191
cmake --preset default --fresh \
9292
-DSLANG_SLANG_LLVM_FLAVOR=FETCH_BINARY \
93-
-DSLANG_SLANG_LLVM_BINARY_URL=$(pwd)/build/dist-release/slang-llvm.zip \
94-
-DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}}
93+
"-DSLANG_SLANG_LLVM_BINARY_URL=$(pwd)/build/dist-release/slang-llvm.zip" \
94+
"-DCMAKE_COMPILE_WARNING_AS_ERROR=${{matrix.warnings-as-errors}}"
9595
cmake --workflow --preset "${{matrix.config}}"
9696
else
9797
# Otherwise, use the system llvm we have just build or got from the
@@ -107,13 +107,13 @@ jobs:
107107
export SLANG_USE_SPV_SOURCE_LANGUAGE_UNKNOWN=1
108108
failed=0
109109
if [[ "${{matrix.full-gpu-tests}}" == "true" ]]; then
110-
$bin_dir/slang-test \
110+
"$bin_dir/slang-test" \
111111
-use-test-server \
112112
-server-count 8 \
113113
-category ${{ matrix.test-category }} \
114114
-api all-cpu ||
115115
failed=1
116-
$bin_dir/slang-test \
116+
"$bin_dir/slang-test" \
117117
-use-test-server \
118118
-server-count 8 \
119119
-emit-spirv-via-glsl \
@@ -122,7 +122,7 @@ jobs:
122122
-expected-failure-list tests/expected-failure.txt ||
123123
failed=1
124124
else
125-
$bin_dir/slang-test \
125+
"$bin_dir/slang-test" \
126126
-use-test-server \
127127
-api all-dx12 \
128128
-category ${{ matrix.test-category }} \

.github/workflows/release-linux-glibc-2-17.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ jobs:
3939
base=$(pwd)/slang-${version}-linux-x86_64-glibc-2.17
4040
4141
sudo mv "$(pwd)/build/dist-release/slang.zip" "${base}.zip"
42-
echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> $GITHUB_OUTPUT
42+
echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> "$GITHUB_OUTPUT"
4343
4444
sudo mv "$(pwd)/build/dist-release/slang.tar.gz" "${base}.tar.gz"
45-
echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> $GITHUB_OUTPUT
45+
echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> "$GITHUB_OUTPUT"
4646
4747
- name: File check
4848
run: |
49-
find "build/dist-release" ! -iname '*.md' ! -iname '*.h' -type f | xargs file
49+
find "build/dist-release" -print0 ! -iname '*.md' ! -iname '*.h' -type f | xargs -0 file
5050
5151
- name: UploadBinary
5252
uses: softprops/action-gh-release@v1

.github/workflows/release.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
- name: Change dev tools to host arch (linux and macos)
6464
run: |
65-
if [[ "${{inputs.os}}" == linux* && "${{inputs.platform}}" == "aarch64" && "$(uname -m)" != "aarch64" ]]; then
65+
if [[ "${{matrix.os}}" == linux* && "${{matrix.platform}}" == "aarch64" && "$(uname -m)" != "aarch64" ]]; then
6666
export CC=aarch64-linux-gnu-gcc
6767
export CXX=aarch64-linux-gnu-g++
6868
fi
@@ -84,8 +84,8 @@ jobs:
8484
-DSLANG_GENERATORS_PATH=build-platform-generators/bin \
8585
-DSLANG_ENABLE_EXAMPLES=OFF \
8686
-DSLANG_EMBED_STDLIB=ON \
87-
-DSLANG_SLANG_LLVM_FLAVOR=$(
88-
[[ "${{matrix.build-slang-llvm}}" = "true" ]] && echo "USE_SYSTEM_LLVM" || echo "DISABLE")
87+
"-DSLANG_SLANG_LLVM_FLAVOR=$(
88+
[[ "${{matrix.build-slang-llvm}}" = "true" ]] && echo "USE_SYSTEM_LLVM" || echo "DISABLE")"
8989
9090
cmake --build --preset "${{matrix.config}}"
9191
@@ -110,18 +110,18 @@ jobs:
110110
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
111111
112112
# import certificate and provisioning profile from secrets
113-
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
113+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output "$CERTIFICATE_PATH"
114114
115115
# create temporary keychain
116-
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
117-
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
118-
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
116+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
117+
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
118+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
119119
120120
# import certificate to keychain
121-
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
122-
security list-keychain -d user -s $KEYCHAIN_PATH
121+
security import "$CERTIFICATE_PATH" -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
122+
security list-keychain -d user -s "$KEYCHAIN_PATH"
123123
124-
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${KEYCHAIN_PASSWORD} $KEYCHAIN_PATH
124+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${KEYCHAIN_PASSWORD}" "$KEYCHAIN_PATH"
125125
126126
binaries=(
127127
"${lib_dir}/libslang.dylib"
@@ -134,14 +134,14 @@ jobs:
134134
)
135135
for b in "${binaries[@]}"; do
136136
if [[ -f "$b" ]]; then
137-
/usr/bin/codesign --force --options runtime -s ${IDENTITY_ID} "$b" -v
137+
/usr/bin/codesign --force --options runtime -s "${IDENTITY_ID}" "$b" -v
138138
7z a "slang-macos-dist.zip" "$b"
139139
fi
140140
done
141141
142142
timeout 1000 gon ./extras/macos-notarize.json
143143
cp slang-macos-dist.zip "slang-macos-dist-${{matrix.platform}}.zip"
144-
echo "SLANG_NOTARIZED_DIST=slang-macos-dist-${{matrix.platform}}.zip" >> $GITHUB_OUTPUT
144+
echo "SLANG_NOTARIZED_DIST=slang-macos-dist-${{matrix.platform}}.zip" >> "$GITHUB_OUTPUT"
145145
146146
- name: Package Slang
147147
id: package
@@ -152,16 +152,16 @@ jobs:
152152
triggering_ref=${{ github.ref_name }}
153153
base=slang-${triggering_ref#v}-${{matrix.os}}-${{matrix.platform}}
154154
mv "$(pwd)/build/dist-${config}/slang.zip" "${base}.zip"
155-
echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> $GITHUB_OUTPUT
155+
echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> "$GITHUB_OUTPUT"
156156
mv "$(pwd)/build/dist-${config}/slang.tar.gz" "${base}.tar.gz"
157-
echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> $GITHUB_OUTPUT
157+
echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> "$GITHUB_OUTPUT"
158158
159159
- name: File check
160160
run: |
161-
find "build/dist-$config" ! -iname '*.md' ! -iname '*.h' -type f | xargs file
161+
find "build/dist-$config" -print0 ! -iname '*.md' ! -iname '*.h' -type f | xargs -0 file
162162
if [ "${{matrix.os}}" = "macos" ]; then
163-
find "build/dist-$config" ! -iname '*.md' ! -iname '*.h' -type f |
164-
xargs codesign --verify --verbose=2 ||
163+
find "build/dist-$config" -print0 ! -iname '*.md' ! -iname '*.h' -type f |
164+
xargs -0 codesign --verify --verbose=2 ||
165165
echo "code signing failed"
166166
fi
167167

.github/workflows/vk-gl-cts-nightly.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
test-category: full
2323
full-gpu-tests: false
2424
runs-on: [Windows, self-hosted]
25+
runs-on: ${{ matrix.runs-on }}
2526
timeout-minutes: 180
2627
defaults:
2728
run:

cmake/SlangTarget.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,12 @@ function(slang_add_target dir type)
301301
set_property(
302302
TARGET ${target}
303303
APPEND
304-
PROPERTY BUILD_RPATH "${ORIGIN}/../${library_subdir}"
304+
PROPERTY BUILD_RPATH "${ORIGIN}/../${library_subdir};${ORIGIN}"
305305
)
306306
set_property(
307307
TARGET ${target}
308308
APPEND
309-
PROPERTY INSTALL_RPATH "${ORIGIN}/../${library_subdir}"
309+
PROPERTY INSTALL_RPATH "${ORIGIN}/../${library_subdir};${ORIGIN}"
310310
)
311311

312312
# On the same topic, give everything a dylib suffix on Mac OS

0 commit comments

Comments
 (0)