Skip to content

feat: Add js-debug adapter support for JavaScript/TypeScript debugging #19

feat: Add js-debug adapter support for JavaScript/TypeScript debugging

feat: Add js-debug adapter support for JavaScript/TypeScript debugging #19

Workflow file for this run

name: E2E Tests
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
REGISTRY: ghcr.io
IMAGE_PREFIX: ghcr.io/${{ github.repository }}
jobs:
# Build the debugger CLI and create base Docker image
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build debugger CLI
run: cargo build --release
- name: Upload debugger binary
uses: actions/upload-artifact@v4
with:
name: debugger-binary
path: target/release/debugger
retention-days: 1
# LLDB tests - C/C++/Rust debugging
test-lldb:
name: LLDB Tests (${{ matrix.os }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download debugger binary
uses: actions/download-artifact@v4
with:
name: debugger-binary
path: target/release/
- name: Make debugger executable
run: chmod +x target/release/debugger
- name: Install LLDB (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y lldb gcc
- name: Compile C test fixtures
run: |
gcc -g tests/fixtures/simple.c -o tests/fixtures/test_simple_c || true
gcc -g tests/e2e/hello_world.c -o tests/e2e/test_c || true
- name: Compile Rust test fixtures
run: |
rustc -g tests/fixtures/simple.rs -o tests/fixtures/test_simple_rs || true
rustc -g tests/e2e/hello_world.rs -o tests/e2e/test_rs || true
- name: Run C Hello World Test
run: ./target/release/debugger test tests/scenarios/hello_world_c.yml --verbose
continue-on-error: true
- name: Run Rust Hello World Test
run: ./target/release/debugger test tests/scenarios/hello_world_rust.yml --verbose
continue-on-error: true
- name: Run Complex Verification Test
run: ./target/release/debugger test tests/scenarios/complex_verification.yml --verbose
continue-on-error: true
- name: Run Rust integration tests
run: cargo test --test integration
continue-on-error: true
- name: Cleanup daemon
if: always()
run: pkill -f "debugger daemon" || true
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: lldb-logs-${{ matrix.os }}
path: ~/.local/share/debugger/logs/
# Delve tests - Go debugging
test-delve:
name: Delve Tests (${{ matrix.os }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download debugger binary
uses: actions/download-artifact@v4
with:
name: debugger-binary
path: target/release/
- name: Make debugger executable
run: chmod +x target/release/debugger
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install Delve
run: go install github.com/go-delve/delve/cmd/dlv@latest
- name: Compile Go test fixtures
run: |
go build -gcflags='all=-N -l' -o tests/e2e/test_go tests/e2e/hello_world.go
go build -gcflags='all=-N -l' -o tests/fixtures/test_simple_go tests/fixtures/simple.go
- name: Run Go Hello World Test
run: ./target/release/debugger test tests/scenarios/hello_world_go.yml --verbose
continue-on-error: true
- name: Run Go Complex Test
run: ./target/release/debugger test tests/scenarios/complex_go.yml --verbose
continue-on-error: true
- name: Cleanup daemon
if: always()
run: pkill -f "debugger daemon" || true
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: delve-logs-${{ matrix.os }}
path: ~/.local/share/debugger/logs/
# debugpy tests - Python debugging
test-debugpy:
name: debugpy Tests (${{ matrix.os }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download debugger binary
uses: actions/download-artifact@v4
with:
name: debugger-binary
path: target/release/
- name: Make debugger executable
run: chmod +x target/release/debugger
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install debugpy
run: pip install debugpy
- name: Run Python Hello World Test
run: ./target/release/debugger test tests/scenarios/hello_world_python.yml --verbose
continue-on-error: true
- name: Cleanup daemon
if: always()
run: pkill -f "debugger daemon" || true
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: debugpy-logs-${{ matrix.os }}
path: ~/.local/share/debugger/logs/
# js-debug tests - JavaScript/TypeScript debugging
test-js-debug:
name: js-debug Tests (${{ matrix.os }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download debugger binary
uses: actions/download-artifact@v4
with:
name: debugger-binary
path: target/release/
- name: Make debugger executable
run: chmod +x target/release/debugger
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install TypeScript and compile fixtures
run: |
npm install -g typescript
cd tests/fixtures && npm install && npx tsc
- name: Setup js-debug adapter
run: ./target/release/debugger setup js-debug || true
- name: Check js-debug installation
run: |
echo "=== Checking js-debug installation ==="
ls -la ~/.local/share/debugger/adapters/ 2>/dev/null || true
find ~/.local/share/debugger/adapters/ -name "*.js" 2>/dev/null | head -5 || true
- name: Run JavaScript Hello World Test
run: ./target/release/debugger test tests/scenarios/hello_world_js.yml --verbose
continue-on-error: true
- name: Run TypeScript Hello World Test
run: ./target/release/debugger test tests/scenarios/hello_world_ts.yml --verbose
continue-on-error: true
- name: Run JavaScript Stepping Test
run: ./target/release/debugger test tests/scenarios/stepping_js.yml --verbose
continue-on-error: true
- name: Run JavaScript Expression Eval Test
run: ./target/release/debugger test tests/scenarios/expression_eval_js.yml --verbose
continue-on-error: true
- name: Cleanup daemon
if: always()
run: pkill -f "debugger daemon" || true
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: js-debug-logs-${{ matrix.os }}
path: ~/.local/share/debugger/logs/
# GDB tests - C/C++ debugging with GDB (native DAP or cdt-gdb-adapter bridge)
test-gdb:
name: GDB Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download debugger binary
uses: actions/download-artifact@v4
with:
name: debugger-binary
path: target/release/
- name: Make debugger executable
run: chmod +x target/release/debugger
- name: Install GDB and build tools
run: |
sudo apt-get update
sudo apt-get install -y gdb gcc g++
- name: Check GDB version
run: gdb --version | head -1
- name: Install Node.js for cdt-gdb-adapter
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install cdt-gdb-adapter (for GDB < 14.1)
run: npm install -g cdt-gdb-adapter || true
- name: Compile C test fixtures
run: |
gcc -g tests/fixtures/simple.c -o tests/fixtures/test_simple_c
gcc -g tests/e2e/hello_world.c -o tests/e2e/test_c
- name: Run C Hello World Test with GDB
run: ./target/release/debugger test tests/scenarios/hello_world_c.yml --adapter gdb --verbose
continue-on-error: true
- name: Cleanup daemon
if: always()
run: pkill -f "debugger daemon" || true
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: gdb-logs
path: ~/.local/share/debugger/logs/
# Integration tests with Rust test framework
integration-tests:
name: Integration Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install LLDB
run: |
sudo apt-get update
sudo apt-get install -y lldb gcc
- name: Install Go and Delve
run: |
sudo apt-get install -y golang-go
go install github.com/go-delve/delve/cmd/dlv@latest
- name: Install Python and debugpy
run: |
sudo apt-get install -y python3 python3-pip
pip3 install debugpy
- name: Install Node.js and js-debug
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Compile test fixtures
run: |
gcc -g tests/fixtures/simple.c -o tests/fixtures/test_simple_c || true
rustc -g tests/fixtures/simple.rs -o tests/fixtures/test_simple_rs || true
go build -gcflags='all=-N -l' -o tests/fixtures/test_simple_go tests/fixtures/simple.go || true
cd tests/fixtures && npm install && npx tsc || true
- name: Run integration tests
run: cargo test --test integration -- --test-threads=1
continue-on-error: true
- name: Cleanup daemon
if: always()
run: pkill -f "debugger daemon" || true
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: integration-logs
path: ~/.local/share/debugger/logs/
# Summary job
e2e-summary:
name: E2E Test Summary
needs: [test-lldb, test-delve, test-debugpy, test-js-debug, test-gdb, integration-tests]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check test results
run: |
echo "## E2E Test Results Summary"
echo ""
echo "| Test Suite | Status |"
echo "|------------|--------|"
echo "| LLDB | ${{ needs.test-lldb.result }} |"
echo "| Delve | ${{ needs.test-delve.result }} |"
echo "| debugpy | ${{ needs.test-debugpy.result }} |"
echo "| js-debug | ${{ needs.test-js-debug.result }} |"
echo "| GDB | ${{ needs.test-gdb.result }} |"
echo "| Integration | ${{ needs.integration-tests.result }} |"
echo ""
# Count successes
success=0
total=6
[ "${{ needs.test-lldb.result }}" == "success" ] && ((success++))
[ "${{ needs.test-delve.result }}" == "success" ] && ((success++))
[ "${{ needs.test-debugpy.result }}" == "success" ] && ((success++))
[ "${{ needs.test-js-debug.result }}" == "success" ] && ((success++))
[ "${{ needs.test-gdb.result }}" == "success" ] && ((success++))
[ "${{ needs.integration-tests.result }}" == "success" ] && ((success++))
echo "**$success/$total test suites passed**"
# Don't fail while stabilizing tests
exit 0