Skip to content

Commit 5699a90

Browse files
committed
Move test out of GH workflow
1 parent 76a09ff commit 5699a90

2 files changed

Lines changed: 12 additions & 18 deletions

File tree

.github/workflows/per-pr.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -194,26 +194,10 @@ jobs:
194194
repo-token: ${{ secrets.GITHUB_TOKEN }}
195195

196196
- name: Build crate as static library
197-
run: |
198-
cargo rustc --package temporal-sdk-core-c-bridge --features xz2-static -- --crate-type=staticlib
199-
ls -lh target/debug/deps/*.a
197+
run: cargo rustc --package temporal-sdk-core-c-bridge --features xz2-static -- --crate-type=staticlib
200198

201199
- name: Build C test program
202-
run: |
203-
cat > test.c <<'EOF'
204-
#include "temporal-sdk-core-c-bridge.h"
205-
#include <stdio.h>
206-
207-
int main(void) {
208-
struct TemporalCoreCancellationToken *tok = temporal_core_cancellation_token_new();
209-
temporal_core_cancellation_token_free(tok);
210-
printf("C bridge static link test passed!\\n");
211-
return 0;
212-
}
213-
EOF
214-
215-
# Compile test.c and link statically against libtemporal_sdk_core_c_bridge.a
216-
gcc -I./core-c-bridge/include test.c target/debug/deps/libtemporal_sdk_core_c_bridge.a -lpthread -ldl -lm -o test
200+
run: gcc -I./core-c-bridge/include tests/c_bridge_smoke_test.c target/debug/deps/libtemporal_sdk_core_c_bridge.a -lpthread -ldl -lm -o test
217201

218202
- name: Run C test program
219203
run: ./test

tests/c_bridge_smoke_test.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "temporal-sdk-core-c-bridge.h"
2+
#include <stdio.h>
3+
4+
int main(void) {
5+
// Just do something simple to confirm the bridge works
6+
struct TemporalCoreCancellationToken *tok = temporal_core_cancellation_token_new();
7+
temporal_core_cancellation_token_free(tok);
8+
printf("C bridge smoke test passed!\n");
9+
return 0;
10+
}

0 commit comments

Comments
 (0)