Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1066854
feat: Implement OpenAI API compatible client and enhance network func…
mikecovlee Mar 20, 2026
be26591
Add test suite for CovScript Network Extension
mikecovlee Jul 1, 2026
bd40c05
Add argparse package for command-line argument parsing
mikecovlee Jul 2, 2026
48e97ac
Update CI script
mikecovlee Jul 2, 2026
8dccbf4
Update CI script
mikecovlee Jul 2, 2026
4cf1002
Fix CI script
mikecovlee Jul 2, 2026
f15b67a
Update CI os image
mikecovlee Jul 2, 2026
e5cf99f
Fix CI script
mikecovlee Jul 2, 2026
01e7a7b
Fix fix fix...
mikecovlee Jul 2, 2026
3b12a6e
fix fix fix...
mikecovlee Jul 2, 2026
057ddc1
shoud be done
mikecovlee Jul 2, 2026
db70a43
fix on windows
mikecovlee Jul 2, 2026
d8e6ad1
fix ci
mikecovlee Jul 2, 2026
79ec4c8
fix fix fix...
mikecovlee Jul 2, 2026
b62eede
optimize ci
mikecovlee Jul 2, 2026
7ac43e7
fix again
mikecovlee Jul 2, 2026
1e620f9
fix
mikecovlee Jul 2, 2026
03b237e
update ci
mikecovlee Jul 2, 2026
0fa58b7
update ci
mikecovlee Jul 2, 2026
069460e
fix ci
mikecovlee Jul 2, 2026
759d729
try with msys2
mikecovlee Jul 2, 2026
8679cd2
try fix ci
mikecovlee Jul 3, 2026
d520a27
try fix ci
mikecovlee Jul 3, 2026
de09048
Add comprehensive tests for TCP, UDP, and TLS functionalities
mikecovlee Jul 3, 2026
73cf286
Enhance CNI API and network module with various improvements
mikecovlee Jul 6, 2026
3bdc034
Fix tests
mikecovlee Jul 6, 2026
54fa378
Fix shutdown
mikecovlee Jul 6, 2026
b8b0d49
feat: Add async architecture documentation for CovScript Network Exte…
mikecovlee Jul 6, 2026
8c1e34c
Update netutils and network modules for improved functionality and er…
mikecovlee Jul 6, 2026
a2a8323
Fix bugs
mikecovlee Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
231 changes: 231 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
# CI for covscript-network extension.
#
# Matrix: 3 platforms x 2 covscript channels (release + nightly) = 6 jobs.
#
# Each job:
# 1. Checks out this extension repo.
# 2. Determines the covscript ref (tag from covscript/csbuild/release.txt, or master HEAD).
# 3. Builds covscript from source (SDK ends up in covscript/csdev/).
# 4. Builds the network extension against that SDK.
# 5. Runs unit tests (no network required).
# 6. Runs integration tests (TLS trust check against public servers).
# 7. Runs DeepSeek test (only when DEEPSEEK_API_KEY secret is set).

name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
name: "${{ matrix.os }} / ${{ matrix.cs-channel }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
cs-channel: [release, nightly]

steps:
# ------------------------------------------------------------------ #
# 1. Check out this extension repo #
# ------------------------------------------------------------------ #
- name: Checkout extension
uses: actions/checkout@v4

# ------------------------------------------------------------------ #
# 2. Determine covscript checkout ref #
# ------------------------------------------------------------------ #
- name: Determine covscript ref
id: cs-ref
shell: bash
run: |
if [ "${{ matrix.cs-channel }}" = "release" ]; then
tag=$(curl -fsSL https://raw.githubusercontent.com/covscript/covscript/master/csbuild/release.txt | tr -d '[:space:]')
echo "ref=$tag" >> "$GITHUB_OUTPUT"
else
echo "ref=master" >> "$GITHUB_OUTPUT"
fi

# ------------------------------------------------------------------ #
# 3. Check out covscript at the resolved ref #
# ------------------------------------------------------------------ #
- name: Checkout covscript (${{ steps.cs-ref.outputs.ref }})
uses: actions/checkout@v4
with:
repository: covscript/covscript
ref: ${{ steps.cs-ref.outputs.ref }}
path: covscript
submodules: recursive

# ------------------------------------------------------------------ #
# 4a. Add MinGW-w64 to PATH (Windows only) #
# ------------------------------------------------------------------ #
- name: Add MinGW to PATH
if: runner.os == 'Windows'
shell: bash
run: echo "C:/mingw64/bin" >> "$GITHUB_PATH"

# ------------------------------------------------------------------ #
# 4b. Build covscript (Linux / macOS) #
# ------------------------------------------------------------------ #
- name: Build covscript
if: runner.os != 'Windows'
working-directory: covscript
shell: bash
run: bash csbuild/make.sh

# ------------------------------------------------------------------ #
# 4c. Build covscript (Windows / MinGW) #
# ------------------------------------------------------------------ #
- name: Build covscript (Windows)
if: runner.os == 'Windows'
working-directory: covscript
shell: cmd
run: csbuild\make.bat

# ------------------------------------------------------------------ #
# 5a. Build extension (Linux / macOS) #
# ------------------------------------------------------------------ #
- name: Build extension
if: runner.os != 'Windows'
shell: bash
env:
CS_DEV_PATH: ${{ github.workspace }}/covscript/csdev
run: |
cmake -G "Unix Makefiles" -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel 4
mkdir -p build/imports
cp build/*.cse build/imports/
cp netutils.csp netutils.csym build/imports/ 2>/dev/null || true

# ------------------------------------------------------------------ #
# 5b. Build extension (Windows / MinGW) #
# ------------------------------------------------------------------ #
- name: Build extension (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
set CS_DEV_PATH=${{ github.workspace }}\covscript\csdev
if not exist build mkdir build
cd build
cmake -G "MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel 4
cd ..
if not exist build\imports mkdir build\imports
copy build\*.cse build\imports\
if exist netutils.csp copy netutils.csp build\imports\
if exist netutils.csym copy netutils.csym build\imports\

# ------------------------------------------------------------------ #
# 6a. Run unit tests (Linux / macOS) #
# ------------------------------------------------------------------ #
- name: Run unit tests
if: runner.os != 'Windows'
shell: bash
run: |
set -e
CS="${{ github.workspace }}/covscript/build/bin/cs"
export PATH="${{ github.workspace }}/covscript/build/bin:$PATH"
"$CS" -i build/imports tests/test_url_parse.csc
"$CS" -i build/imports tests/test_header_parser.csc
"$CS" -i build/imports tests/test_openai_client.csc

# ------------------------------------------------------------------ #
# 6b. Run unit tests (Windows) #
# ------------------------------------------------------------------ #
- name: Run unit tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$cs = "${{ github.workspace }}\covscript\build\bin\cs.exe"
$env:Path = "${{ github.workspace }}\covscript\build\bin;$env:Path"
& $cs -i build\imports tests\test_url_parse.csc
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
& $cs -i build\imports tests\test_header_parser.csc
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
& $cs -i build\imports tests\test_openai_client.csc
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

# ------------------------------------------------------------------ #
# 7a. Run async TCP test (Linux / macOS) #
# ------------------------------------------------------------------ #
- name: Run async TCP test
if: runner.os != 'Windows'
shell: bash
run: |
set -e
CS="${{ github.workspace }}/covscript/build/bin/cs"
export PATH="${{ github.workspace }}/covscript/build/bin:$PATH"
"$CS" -i build/imports tests/test_async_tcp.csc

# ------------------------------------------------------------------ #
# 7b. Run async TCP test (Windows) #
# ------------------------------------------------------------------ #
- name: Run async TCP test (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$cs = "${{ github.workspace }}\covscript\build\bin\cs.exe"
$env:Path = "${{ github.workspace }}\covscript\build\bin;$env:Path"
& $cs -i build\imports tests\test_async_tcp.csc
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

# ------------------------------------------------------------------ #
# 8a. Run integration tests (Linux / macOS) #
# ------------------------------------------------------------------ #
- name: Run integration tests
if: runner.os != 'Windows'
shell: bash
run: |
set -e
CS="${{ github.workspace }}/covscript/build/bin/cs"
export PATH="${{ github.workspace }}/covscript/build/bin:$PATH"
"$CS" -i build/imports tests/test_tls_trust.csc

# ------------------------------------------------------------------ #
# 8b. Run integration tests (Windows) #
# ------------------------------------------------------------------ #
- name: Run integration tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$cs = "${{ github.workspace }}\covscript\build\bin\cs.exe"
$env:Path = "${{ github.workspace }}\covscript\build\bin;$env:Path"
& $cs -i build\imports tests\test_tls_trust.csc
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

# ------------------------------------------------------------------ #
# 9a. Run DeepSeek test (only when API key is available) #
# ------------------------------------------------------------------ #
- name: Run DeepSeek test
if: runner.os != 'Windows' && env.DEEPSEEK_API_KEY != ''
Comment thread
mikecovlee marked this conversation as resolved.
Outdated
shell: bash
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
run: |
set -e
CS="${{ github.workspace }}/covscript/build/bin/cs"
export PATH="${{ github.workspace }}/covscript/build/bin:$PATH"
"$CS" -i build/imports tests/test_deepseek.csc

# ------------------------------------------------------------------ #
# 9b. Run DeepSeek test (Windows, only when API key is available) #
# ------------------------------------------------------------------ #
- name: Run DeepSeek test (Windows)
if: runner.os == 'Windows' && env.DEEPSEEK_API_KEY != ''
Comment thread
mikecovlee marked this conversation as resolved.
Outdated
shell: pwsh
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
run: |
$cs = "${{ github.workspace }}\covscript\build\bin\cs.exe"
$env:Path = "${{ github.workspace }}\covscript\build\bin;$env:Path"
& $cs -i build\imports tests\test_deepseek.csc
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ examples/*.csc
*.log
*.db
authorized_keys

# Compiled CovScript output
test_call_deepseek.csc
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ else ()
message(FATAL_ERROR "-- CovScript SDK not detected. Please set environment variable CS_DEV_PATH")
endif ()

find_package(OpenSSL REQUIRED)

add_library(network SHARED network.cpp)

target_link_libraries(network covscript)
target_link_libraries(network covscript OpenSSL::SSL OpenSSL::Crypto)

if (WIN32)
target_link_libraries(network ws2_32 wsock32)
target_link_libraries(network ws2_32 wsock32 bcrypt crypt32)
else ()
target_link_libraries(network pthread)
endif ()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion csbuild/netutils.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Name": "netutils",
"Info": "Network Utilities",
"Author": "CovScript Organization",
"Version": "1.2.1",
"Version": "1.3",
"Target": "netutils.csp",
"Dependencies": [
"network",
Expand Down
2 changes: 1 addition & 1 deletion csbuild/netutils_csym.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Name": "netutils.csym",
"Info": "Network Utilities cSYM Module",
"Author": "CovScript Organization",
"Version": "1.2.1",
"Version": "1.3",
"Target": "netutils.csym",
"Dependencies": [
"netutils"
Expand Down
2 changes: 1 addition & 1 deletion csbuild/network.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Name": "network",
"Info": "Socket Extension",
"Author": "CovScript Organization",
"Version": "1.38.0_v5.6",
"Version": "1.38.0_v5.7",
"Target": "build/imports/network.cse",
"Dependencies": []
}
File renamed without changes.
Loading
Loading