name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x]
python-version: ['3.10', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run tests
run: npm test
- name: Test help command
run: node bin/markitdown-mcp-npx.js --help
- name: Test package structure (Unix)
if: runner.os != 'Windows'
run: |
test -f package.json || exit 1
test -f README.md || exit 1
test -f LICENSE || exit 1
test -f bin/markitdown-mcp-npx.js || exit 1
test -f index.js || exit 1
echo "✅ All required files found"
- name: Test package structure (Windows)
if: runner.os == 'Windows'
run: |
if (!(Test-Path "package.json")) { exit 1 }
if (!(Test-Path "README.md")) { exit 1 }
if (!(Test-Path "LICENSE")) { exit 1 }
if (!(Test-Path "bin/markitdown-mcp-npx.js")) { exit 1 }
if (!(Test-Path "index.js")) { exit 1 }
Write-Output "✅ All required files found"
shell: powershell
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Check package.json validity
run: |
# Check if package.json is valid JSON
node -e "JSON.parse(require('fs').readFileSync('package.json', 'utf8')); console.log('✅ package.json is valid JSON');"
# Check required fields
node -e "
const pkg = JSON.parse(require('fs').readFileSync('package.json', 'utf8'));
const required = ['name', 'version', 'description', 'main', 'bin', 'license'];
const missing = required.filter(field => !pkg[field]);
if (missing.length > 0) {
console.error('❌ Missing required fields:', missing.join(', '));
process.exit(1);
}
console.log('✅ All required package.json fields present');
"
- name: Verify no actual dependencies needed
run: |
echo "✅ Package uses only Node.js built-in modules"
node -e "console.log('✅ Node.js version:', process.version)"