Skip to content
Open
Show file tree
Hide file tree
Changes from 29 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
278 changes: 278 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
# CI for covscript-network extension.

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-24.04, macos-15, windows-2022]
cs-channel: [release, nightly]

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

# ------------------------------------------------------------------ #
# 2. Set platform identifiers #
# ------------------------------------------------------------------ #
- name: Set platform identifiers
id: platform
shell: bash
run: |
case "${{ runner.os }}" in
Linux) echo "os=ubuntu" >> "$GITHUB_OUTPUT"
echo "arch=x86_64" >> "$GITHUB_OUTPUT"
echo "cspkg_arch=amd64" >> "$GITHUB_OUTPUT"
echo "cspkg_arch_dir=ubuntu/x86_64" >> "$GITHUB_OUTPUT" ;;
macOS) echo "os=macos" >> "$GITHUB_OUTPUT"
echo "arch=arm64" >> "$GITHUB_OUTPUT"
echo "cspkg_arch=arm64" >> "$GITHUB_OUTPUT"
echo "cspkg_arch_dir=darwin/arm64" >> "$GITHUB_OUTPUT" ;;
Windows) echo "os=windows" >> "$GITHUB_OUTPUT"
echo "arch=x86_64" >> "$GITHUB_OUTPUT"
echo "cspkg_arch=amd64" >> "$GITHUB_OUTPUT"
echo "cspkg_arch_dir=windows-ucrt/amd64" >> "$GITHUB_OUTPUT" ;;
esac

# ------------------------------------------------------------------ #
# 3. Determine release tag #
# ------------------------------------------------------------------ #
- name: Determine csbuild release
id: cs-release
shell: bash
run: |
if [ "${{ matrix.cs-channel }}" = "release" ]; then
echo "tag=${{ steps.platform.outputs.os }}-schedule-release" >> "$GITHUB_OUTPUT"
echo "suffix=" >> "$GITHUB_OUTPUT"
else
echo "tag=${{ steps.platform.outputs.os }}-schedule" >> "$GITHUB_OUTPUT"
echo "suffix=-nightly" >> "$GITHUB_OUTPUT"
fi

# ------------------------------------------------------------------ #
# 4. Download & extract covscript SDK + cspkg repo #
# ------------------------------------------------------------------ #
- name: Download covscript SDK
id: sdk
shell: bash
run: |
TAG="${{ steps.cs-release.outputs.tag }}"
ARCH="${{ steps.platform.outputs.arch }}"
OS="${{ steps.platform.outputs.os }}"
SUFFIX="${{ steps.cs-release.outputs.suffix }}"
BASE="https://github.com/covscript/csbuild/releases/download/${TAG}"
COV="covscript-${OS}-${ARCH}${SUFFIX}.7z"
PKG="cspkg-${OS}-${ARCH}${SUFFIX}.7z"

echo "Downloading ${COV}..."
curl -fsSL -o covscript.7z "${BASE}/${COV}"
echo "Downloading ${PKG}..."
curl -fsSL -o cspkg.7z "${BASE}/${PKG}"

7z x covscript.7z -y
mv build covscript-home
7z x cspkg.7z -y

CS_HOME="${{ github.workspace }}/covscript-home"
CS_HOME="${CS_HOME//\\//}"
echo "cs_home=${CS_HOME}" >> "$GITHUB_OUTPUT"

echo "=== covscript-home ==="
ls -la covscript-home/
echo "=== covscript-home/bin ==="
ls -la covscript-home/bin/
echo "=== cspkg-repo ==="
ls -la cspkg-repo/

# ------------------------------------------------------------------ #
# 5. Configure cspkg #
# ------------------------------------------------------------------ #
- name: Configure cspkg
shell: bash
run: |
mkdir -p "$HOME/.cspkg"

CS_HOME="${{ steps.sdk.outputs.cs_home }}"
WS="${{ github.workspace }}"
WS="${WS//\\//}"

if [[ "$WS" =~ ^[A-Za-z]:/ ]]; then
SOURCE_URL="file:///${WS}/cspkg-repo/"
else
SOURCE_URL="file://${WS}/cspkg-repo/"
fi

cat > "$HOME/.cspkg/config.json" << EOF
{
"arch": "${{ steps.platform.outputs.cspkg_arch }}",
"home": "${CS_HOME}",
"source": "${SOURCE_URL}",
"timeout_ms": 3000
}
EOF

echo "=== cspkg config ==="
cat "$HOME/.cspkg/config.json"

# ------------------------------------------------------------------ #
# 6. Persist environment for later steps #
# ------------------------------------------------------------------ #
- name: Setup environment
shell: bash
run: |
CS_HOME="${{ steps.sdk.outputs.cs_home }}"
echo "COVSCRIPT_HOME=${CS_HOME}" >> "$GITHUB_ENV"
echo "${CS_HOME}/bin" >> "$GITHUB_PATH"

# ------------------------------------------------------------------ #
# 7. Run cspkg install #
# ------------------------------------------------------------------ #
- name: Run cspkg install
shell: bash
run: |
if [ "${{ runner.os }}" != "Windows" ]; then
chmod -R +x "$COVSCRIPT_HOME/bin/"
fi
cspkg install --import --yes
cspkg install ecs_bootstrap --yes
cspkg version
cspkg list

# ------------------------------------------------------------------ #
# 8. Setup MSYS2 + OpenSSL (Windows only) #
# ------------------------------------------------------------------ #
- name: Setup MSYS2
if: runner.os == 'Windows'
id: msys2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-make
mingw-w64-ucrt-x86_64-openssl

# ------------------------------------------------------------------ #
# 9a. Build extension (Linux / macOS) #
# ------------------------------------------------------------------ #
- name: Build extension
if: runner.os != 'Windows'
shell: bash
env:
CS_DEV_PATH: ${{ steps.sdk.outputs.cs_home }}/
run: bash csbuild/make.sh

# ------------------------------------------------------------------ #
# 9b. Build extension (Windows / MSYS2 UCRT64) #
# ------------------------------------------------------------------ #
- name: Build extension (Windows)
if: runner.os == 'Windows'
shell: bash
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
run: |
export PATH="${{ steps.msys2.outputs.msys2-location }}/ucrt64/bin:${PATH}"
export CS_DEV_PATH="$(cygpath -u "${{ steps.sdk.outputs.cs_home }}")/"
bash csbuild/make.sh

# ------------------------------------------------------------------ #
# 10. Install built extension + packages #
# ------------------------------------------------------------------ #
- name: Install local build
shell: bash
run: |
cspkg build . --install
cspkg list

# ------------------------------------------------------------------ #
# 11. Run unit tests #
# ------------------------------------------------------------------ #
- name: Run unit tests
shell: bash
run: |
set -e
cs tests/test_url_parse.csc
cs tests/test_header_parser.csc
cs tests/test_utils.csc
cs tests/test_tcp_sync.csc
cs tests/test_openai_client.csc

# ------------------------------------------------------------------ #
# 12. Run UDP tests #
# ------------------------------------------------------------------ #
- name: Run UDP tests
shell: bash
run: |
set -e
cs tests/test_udp.csc

# ------------------------------------------------------------------ #
# 13. Run HTTP round-trip tests #
# ------------------------------------------------------------------ #
- name: Run HTTP round-trip tests
shell: bash
run: |
set -e
cs tests/test_http_roundtrip.csc

# ------------------------------------------------------------------ #
# 14. Run fiber + socket tests #
# ------------------------------------------------------------------ #
- name: Run fiber socket tests
shell: bash
run: |
set -e
cs tests/test_fiber_socket.csc

# ------------------------------------------------------------------ #
# 15. Run async TCP test #
# ------------------------------------------------------------------ #
- name: Run async TCP test
shell: bash
run: |
set -e
cs tests/test_async_tcp.csc

# ------------------------------------------------------------------ #
# 16. Run integration tests #
# ------------------------------------------------------------------ #
- name: Run integration tests
shell: bash
run: |
set -e
cs tests/test_tls_trust.csc
cs tests/test_tls_errors.csc

# ------------------------------------------------------------------ #
# 17. Run DeepSeek test (only when API key is available) #
# ------------------------------------------------------------------ #
- name: Run DeepSeek test
shell: bash
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
run: |
if [ -z "$DEEPSEEK_API_KEY" ]; then
echo "DEEPSEEK_API_KEY not set — skipping test"
exit 0
fi
set -e
cs tests/test_deepseek.csc
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
Loading