From ac1d4acd5c6009b94ff3cba2913611668003558a Mon Sep 17 00:00:00 2001 From: Rohan Kumar Mahato Date: Fri, 10 Jan 2025 00:24:50 +0530 Subject: [PATCH 1/5] debug ci --- .github/workflows/ci.yml | 93 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 88 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6499e6..1c06f9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,98 @@ - -name: CI Linux Build and Test +name: CI on: - workflow_dispatch: - pull_request: push: branches: - master + - Debug_CI + pull_request: + branches: + - master + - Debug_CI jobs: - test: + Linux_test: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up Dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + ca-certificates \ + git \ + liburing-dev \ + cmake \ + curl + - name: Clone and Build MetaCall + run: | + git clone --branch v0.8.7 https://github.com/metacall/core + cd core + ./tools/metacall-environment.sh release base nodejs c + sudo mkdir build && cd build + sudo cmake \ + -DOPTION_BUILD_LOADERS_C=On \ + -DOPTION_BUILD_LOADERS_NODE=On \ + -DOPTION_BUILD_PORTS=On \ + -DOPTION_BUILD_PORTS_NODE=On \ + -DOPTION_BUILD_DETOURS=Off \ + -DOPTION_BUILD_SCRIPTS=Off \ + -DOPTION_BUILD_TESTS=Off \ + -DOPTION_BUILD_EXAMPLES=Off \ + .. + sudo cmake --build . --target install + sudo ldconfig /usr/local/lib + cd ../.. + sudo rm -rf core + + - name: Set path & Run MetaCall Example + run: | + export LOADER_LIBRARY_PATH="/usr/local/lib" + export LOADER_SCRIPT_PATH="/home/runner/work/nodejs-c-io_uring-example/nodejs-c-io_uring-example/scripts" # path of the scripts + nohup metacallcli index.js & # running the server in the background + echo $! > metacall_pid.txt # Save the PID of the process to a file + + - name: Wait for server to be ready + run: | + for i in {1..10}; do + if curl -s http://localhost:8000 > /dev/null; then + echo "Server is up!" + exit 0 + fi + echo "Waiting for server..." + sleep 3 + done + echo "Server did not start in time." + exit 1 + shell: bash + + - name: Test server response + run: | + RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000) + if [ "$RESPONSE" -eq 200 ]; then + echo "Server responded with HTTP 200 OK." + else + echo "Server did not respond with HTTP 200. Response code: $RESPONSE" + exit 1 + fi + shell: bash + + - name: Kill MetaCall process (free port 8000) + run: | + if [ -f metacall_pid.txt ]; then + PID=$(cat metacall_pid.txt) + echo "Killing process with PID $PID" + kill $PID + rm metacall_pid.txt # Remove the PID file after killing the process + else + echo "PID file not found. No process to kill." + fi + shell: bash + + docker: runs-on: ubuntu-latest steps: - name: Checkout Code From c92b399fc485365d6009d68f702345678a3e9257 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Mahato Date: Fri, 10 Jan 2025 00:38:58 +0530 Subject: [PATCH 2/5] added the CI and checking if the Linux_test works --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c06f9b..75514ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,11 +4,11 @@ on: push: branches: - master - - Debug_CI + - DebugCI pull_request: branches: - master - - Debug_CI + - DebugCI jobs: Linux_test: From 83f7a79a1a87a1015594c271f8bc2257d91d76a6 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Mahato Date: Fri, 10 Jan 2025 00:57:11 +0530 Subject: [PATCH 3/5] changing the actions version from 3 to 4 and checking if the issue is with the version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75514ca..e8dcb38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Dependencies run: | From 4382fcb225153b3ebc9550abae2dae1d36ce8845 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Mahato Date: Fri, 10 Jan 2025 09:02:39 +0530 Subject: [PATCH 4/5] forcing it to use ubuntu 22.04 instead of ubuntu-latest it should fail linux_test on my repository --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8dcb38..51ade11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: jobs: Linux_test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout Code From 4d2bf68a774676d34e1d3a3c530f0e2080a73773 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Mahato Date: Fri, 10 Jan 2025 11:18:34 +0530 Subject: [PATCH 5/5] forcing ubuntu 24.04 this should pass the linux_test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51ade11..d6a2ba2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: jobs: Linux_test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout Code