name: Quick Validation
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quick-checks:
name: Quick Validation Checks
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install minimal dependencies
run: |
python -m pip install --upgrade pip
pip install ruff==0.12.9
# Install core dependencies for import validation
pip install mcp[cli]>=1.10.0 simplenote>=2.1.4 requests>=2.32.4
- name: Quick syntax check
run: |
echo "🔍 Running quick syntax validation..."
ruff check --select=F,E9 . --output-format=github
echo "✅ Syntax check passed"
- name: Import validation
run: |
echo "📦 Testing core package imports..."
python -c "
import sys
sys.path.insert(0, '.')
try:
import simplenote_mcp
print('✅ Main package imports successfully')
except ImportError as e:
print(f'❌ Import failed: {e}')
sys.exit(1)
except Exception as e:
print(f'⚠️ Import warning: {e}')
try:
from simplenote_mcp.server import server
print('✅ Server module imports successfully')
except ImportError as e:
print(f'❌ Server import failed: {e}')
sys.exit(1)
except Exception as e:
print(f'⚠️ Server import warning: {e}')
"
- name: Critical file check
run: |
echo "📁 Checking critical files..."
required_files=(
"simplenote_mcp/__init__.py"
"simplenote_mcp/server/server.py"
"pyproject.toml"
)
for file in "${required_files[@]}"; do
if [ -f "$file" ]; then
echo "✅ $file exists"
else
echo "❌ $file missing"
exit 1
fi
done
- name: Quick PR validation
if: github.event_name == 'pull_request'
run: |
echo "🔍 PR Quick Validation Summary"
echo "==============================="
echo "PR Number: ${{ github.event.number }}"
echo "Base Branch: ${{ github.base_ref }}"
echo "Head Branch: ${{ github.head_ref }}"
echo "Changed Files:"
git diff --name-only origin/${{ github.base_ref }}...HEAD | head -10
echo "✅ Quick validation completed successfully"
- name: Quick security scan
run: |
echo "🔒 Running quick security pre-check..."
ruff check --select=S102,S106,S107,S108 . --output-format=github || echo "⚠️ Security warnings found (non-blocking)"
echo "✅ Security pre-check completed"
- name: Set validation status
if: success()
run: |
echo "🎉 Quick validation passed! Full CI/CD pipeline will run next."
echo "validation=success" >> $GITHUB_ENV
- name: Comment on PR with quick results
if: github.event_name == 'pull_request' && success() && github.actor != 'dependabot[bot]'
uses: actions/github-script@v7
with:
script: |
const comment = `## ⚡ Quick Validation Results
✅ **All quick checks passed!**
- Syntax validation: ✅ Passed
- Import validation: ✅ Passed
- Critical files: ✅ Present
The full CI/CD pipeline is now running. This PR looks good for initial review!`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});