Skip to content

Commit

Permalink
add hello test
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Chaudhary <[email protected]>
  • Loading branch information
ispeakc0de committed May 16, 2024
1 parent 074c413 commit fc5796e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
run: gcc -shared -fPIC nsutil.c -o ./../../build/_output/nsutil_amd64.so
working-directory: custom/nsutil

- name: Build shared libraries for hello amd64
run: gcc hello.c -o ./../../build/_output/hello_amd64
working-directory: custom/nsutil

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

Expand All @@ -50,6 +54,10 @@ jobs:
run: docker create --name myapp-arm64-container myapp-arm64 && docker cp myapp-arm64-container:/app/nsutil.so ./../../build/_output/nsutil_arm64.so
working-directory: custom/nsutil

- name: Extract compiled binary hello
run: docker create --name myapp-arm64-container1 myapp-arm64 && docker cp myapp-arm64-container1:/app/hello ./../../build/_output/hello_arm64
working-directory: custom/nsutil

- name: Build go binary for promql-cli
run : |
cp custom/promql-cli/promql-linux-amd64 build/_output/
Expand Down
6 changes: 6 additions & 0 deletions custom/nsutil/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ WORKDIR /app
# Copy your C code into the container
COPY nsutil.c /app

# Copy your C code into the container
COPY hello.c /app

# Compile the C code
RUN gcc -shared -fPIC nsutil.c -o nsutil.so

# Compile the C code
RUN gcc hello.c -o hello
8 changes: 8 additions & 0 deletions custom/nsutil/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <stdio.h>

int main(int argc, const char *argv[])
{
printf("Hello World!\n");

return 0;
}

0 comments on commit fc5796e

Please sign in to comment.