chore(ci): remove obsolete GitHub Actions workflows
This commit is contained in:
parent
27f6a543be
commit
7701fcd479
238
.github/workflows/nexus-mcp-ci.yml
vendored
238
.github/workflows/nexus-mcp-ci.yml
vendored
@ -1,238 +0,0 @@
|
|||||||
name: Nexus MCP - CI/CD Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main, develop, rebuild-* ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main, develop ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: Test Suite
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version: ["3.11", "3.12", "3.13"]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
|
|
||||||
- name: Cache pip dependencies
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('nexus-mcp/pyproject.toml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pip-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -e .
|
|
||||||
pip install pytest pytest-cov pytest-asyncio black ruff
|
|
||||||
|
|
||||||
- name: Lint with ruff
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
ruff check src/ lib/ tests/ --ignore E501,F401
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Format check with black
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
black --check --diff src/ lib/ tests/
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Run unit tests
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
pytest tests/workday_tests/test_mismatch_scans.py -v --tb=short
|
|
||||||
|
|
||||||
- name: Run integration tests
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
pytest tests/integration_test_audit_shard.py -v --tb=short
|
|
||||||
|
|
||||||
- name: Run all tests with coverage
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
pytest tests/ -v --cov=src --cov=lib --cov-report=term --cov-report=xml
|
|
||||||
|
|
||||||
- name: Upload coverage reports
|
|
||||||
uses: codecov/codecov-action@v3
|
|
||||||
with:
|
|
||||||
file: nexus-mcp/coverage.xml
|
|
||||||
flags: unittests
|
|
||||||
name: codecov-${{ matrix.python-version }}
|
|
||||||
if: matrix.python-version == '3.13'
|
|
||||||
|
|
||||||
validate-server:
|
|
||||||
name: Validate MCP Server
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: test
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.13"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -e .
|
|
||||||
|
|
||||||
- name: Validate server imports
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
python -c "
|
|
||||||
import sys, os
|
|
||||||
sys.path.insert(0, 'lib')
|
|
||||||
sys.path.insert(0, 'src')
|
|
||||||
from dotenv import load_dotenv
|
|
||||||
load_dotenv()
|
|
||||||
from mcp.server.fastmcp import FastMCP
|
|
||||||
from shards import identity, workday, itsm, assets, logistics, audit
|
|
||||||
print('✅ All imports successful')
|
|
||||||
"
|
|
||||||
|
|
||||||
- name: Test server initialization
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
python test_client.py > /tmp/test_output.txt
|
|
||||||
grep -q "All audit tools executed successfully" /tmp/test_output.txt
|
|
||||||
echo "✅ Server initialization validated"
|
|
||||||
|
|
||||||
- name: Verify tool registration
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
python list_tools.py > /tmp/tools.txt
|
|
||||||
grep -q "48 tools available" /tmp/tools.txt
|
|
||||||
echo "✅ Tool registration validated"
|
|
||||||
|
|
||||||
security-scan:
|
|
||||||
name: Security & Dependency Check
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.13"
|
|
||||||
|
|
||||||
- name: Install safety
|
|
||||||
run: pip install safety
|
|
||||||
|
|
||||||
- name: Check dependencies for vulnerabilities
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: |
|
|
||||||
pip install -e .
|
|
||||||
safety check --json || echo "⚠️ Security vulnerabilities found"
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Scan for secrets
|
|
||||||
uses: trufflesecurity/trufflehog@main
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
base: ${{ github.event.repository.default_branch }}
|
|
||||||
head: HEAD
|
|
||||||
|
|
||||||
version-check:
|
|
||||||
name: Version & Changelog Check
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Check version bump
|
|
||||||
run: |
|
|
||||||
CURRENT_VERSION=$(grep -Po 'version = "\K[^"]*' nexus-mcp/pyproject.toml)
|
|
||||||
echo "Current version: $CURRENT_VERSION"
|
|
||||||
|
|
||||||
# Get main branch version
|
|
||||||
git fetch origin main
|
|
||||||
MAIN_VERSION=$(git show origin/main:nexus-mcp/pyproject.toml | grep -Po 'version = "\K[^"]*')
|
|
||||||
echo "Main branch version: $MAIN_VERSION"
|
|
||||||
|
|
||||||
if [ "$CURRENT_VERSION" == "$MAIN_VERSION" ]; then
|
|
||||||
echo "⚠️ Version not bumped in pyproject.toml"
|
|
||||||
echo "Please update version before merging to main"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "✅ Version bumped: $MAIN_VERSION → $CURRENT_VERSION"
|
|
||||||
|
|
||||||
- name: Check for CHANGELOG updates
|
|
||||||
run: |
|
|
||||||
if ! git diff origin/main...HEAD --name-only | grep -q "CHANGELOG.md\|nexus-mcp/README.md"; then
|
|
||||||
echo "⚠️ No CHANGELOG or README updates detected"
|
|
||||||
echo "Consider documenting your changes"
|
|
||||||
else
|
|
||||||
echo "✅ Documentation updated"
|
|
||||||
fi
|
|
||||||
|
|
||||||
build:
|
|
||||||
name: Build Distribution
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [test, validate-server]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.13"
|
|
||||||
|
|
||||||
- name: Install build tools
|
|
||||||
run: pip install build twine
|
|
||||||
|
|
||||||
- name: Build package
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: python -m build
|
|
||||||
|
|
||||||
- name: Check distribution
|
|
||||||
working-directory: nexus-mcp
|
|
||||||
run: twine check dist/*
|
|
||||||
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: nexus-mcp-dist-${{ github.sha }}
|
|
||||||
path: nexus-mcp/dist/
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
notify:
|
|
||||||
name: Notify Status
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [test, validate-server, security-scan, build]
|
|
||||||
if: always()
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Report status
|
|
||||||
run: |
|
|
||||||
echo "Pipeline completed"
|
|
||||||
echo "Tests: ${{ needs.test.result }}"
|
|
||||||
echo "Validation: ${{ needs.validate-server.result }}"
|
|
||||||
echo "Security: ${{ needs.security-scan.result }}"
|
|
||||||
echo "Build: ${{ needs.build.result }}"
|
|
||||||
118
.github/workflows/version-bump.yml
vendored
118
.github/workflows/version-bump.yml
vendored
@ -1,118 +0,0 @@
|
|||||||
name: Auto Version Bump
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
bump_type:
|
|
||||||
description: 'Version bump type'
|
|
||||||
required: true
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- patch
|
|
||||||
- minor
|
|
||||||
- major
|
|
||||||
update_readme:
|
|
||||||
description: 'Update README with changes'
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
bump-version:
|
|
||||||
name: Bump Version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.13"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pip install toml
|
|
||||||
|
|
||||||
- name: Bump version
|
|
||||||
id: bump
|
|
||||||
run: |
|
|
||||||
python3 << 'EOF'
|
|
||||||
import toml
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# Read current version
|
|
||||||
with open('nexus-mcp/pyproject.toml', 'r') as f:
|
|
||||||
config = toml.load(f)
|
|
||||||
|
|
||||||
current = config['project']['version']
|
|
||||||
major, minor, patch = map(int, current.split('.'))
|
|
||||||
|
|
||||||
bump_type = '${{ github.event.inputs.bump_type }}'
|
|
||||||
|
|
||||||
if bump_type == 'major':
|
|
||||||
major += 1
|
|
||||||
minor = 0
|
|
||||||
patch = 0
|
|
||||||
elif bump_type == 'minor':
|
|
||||||
minor += 1
|
|
||||||
patch = 0
|
|
||||||
else: # patch
|
|
||||||
patch += 1
|
|
||||||
|
|
||||||
new_version = f"{major}.{minor}.{patch}"
|
|
||||||
|
|
||||||
# Update version
|
|
||||||
config['project']['version'] = new_version
|
|
||||||
|
|
||||||
with open('nexus-mcp/pyproject.toml', 'w') as f:
|
|
||||||
toml.dump(config, f)
|
|
||||||
|
|
||||||
print(f"{current}→{new_version}")
|
|
||||||
|
|
||||||
# Export for GitHub Actions
|
|
||||||
with open(process.env['GITHUB_OUTPUT'], 'a') as f:
|
|
||||||
f.write(f"old_version={current}\n")
|
|
||||||
f.write(f"new_version={new_version}\n")
|
|
||||||
EOF
|
|
||||||
|
|
||||||
- name: Update README
|
|
||||||
if: github.event.inputs.update_readme == 'true'
|
|
||||||
run: |
|
|
||||||
DATE=$(date +"%Y-%m-%d")
|
|
||||||
OLD="${{ steps.bump.outputs.old_version }}"
|
|
||||||
NEW="${{ steps.bump.outputs.new_version }}"
|
|
||||||
|
|
||||||
# Add version entry to README
|
|
||||||
sed -i "s/version = \"$OLD\"/version = \"$NEW\"/" nexus-mcp/pyproject.toml
|
|
||||||
|
|
||||||
echo "Updated version: $OLD → $NEW"
|
|
||||||
|
|
||||||
- name: Commit changes
|
|
||||||
run: |
|
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
git add nexus-mcp/pyproject.toml
|
|
||||||
git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }}"
|
|
||||||
git tag "v${{ steps.bump.outputs.new_version }}"
|
|
||||||
|
|
||||||
- name: Push changes
|
|
||||||
uses: ad-m/github-push-action@master
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
branch: ${{ github.ref }}
|
|
||||||
tags: true
|
|
||||||
|
|
||||||
- name: Create Release Notes
|
|
||||||
run: |
|
|
||||||
echo "## Release v${{ steps.bump.outputs.new_version }}" > release_notes.md
|
|
||||||
echo "" >> release_notes.md
|
|
||||||
echo "**Previous version:** ${{ steps.bump.outputs.old_version }}" >> release_notes.md
|
|
||||||
echo "**Bump type:** ${{ github.event.inputs.bump_type }}" >> release_notes.md
|
|
||||||
echo "" >> release_notes.md
|
|
||||||
echo "### Changes" >> release_notes.md
|
|
||||||
git log v${{ steps.bump.outputs.old_version }}..HEAD --pretty=format:"- %s" >> release_notes.md
|
|
||||||
|
|
||||||
cat release_notes.md
|
|
||||||
Loading…
x
Reference in New Issue
Block a user