We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AbdallahAHO/lokalise-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
name: CI - Code Quality
# This workflow runs on every pull request and push to main branches
# It performs formatting checks, linting, building, and testing
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
types: [opened, synchronize, reopened]
# Cancel in-progress runs when a new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Job 1: Code Quality Checks
quality:
name: π¨ Code Quality
runs-on: ubuntu-latest
steps:
- name: π₯ Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0 # Full history for better analysis
- name: π¦ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: π Install dependencies
run: |
echo "π¦ Installing dependencies..."
npm ci
echo "β
Dependencies installed"
- name: π¨ Check formatting
id: format
run: |
echo "π¨ Checking code formatting with Biome..."
npm run format
# Check if there are any changes
if [[ -n $(git status --porcelain) ]]; then
echo "β Code formatting issues found!"
echo "formatting_issues=true" >> $GITHUB_OUTPUT
# Show what files would be formatted
echo "π Files with formatting issues:"
git status --porcelain
# Create a comment body
echo "## π¨ Formatting Issues Found" >> format-comment.md
echo "" >> format-comment.md
echo "Please run \`npm run format\` locally to fix formatting issues." >> format-comment.md
echo "" >> format-comment.md
echo "Files that need formatting:" >> format-comment.md
echo "\`\`\`" >> format-comment.md
git status --porcelain | sed 's/^ M //' >> format-comment.md
echo "\`\`\`" >> format-comment.md
exit 1
else
echo "β
Code formatting is perfect!"
echo "formatting_issues=false" >> $GITHUB_OUTPUT
fi
- name: π Run linter
id: lint
run: |
echo "π Running linter..."
npm run lint || {
echo "β Linting issues found!"
echo "lint_issues=true" >> $GITHUB_OUTPUT
exit 1
}
echo "β
No linting issues found!"
echo "lint_issues=false" >> $GITHUB_OUTPUT
# Job 2: Build
build:
name: π¨ Build
runs-on: ubuntu-latest
needs: quality # Only run if quality checks pass
steps:
- name: π₯ Checkout code
uses: actions/checkout@v5
- name: π¦ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: π Install dependencies
run: |
echo "π¦ Installing dependencies..."
npm ci
echo "β
Dependencies installed"
- name: π¨ Build project
run: |
echo "π¨ Building project..."
npm run build
echo "β
Build successful!"
- name: π Check build output
run: |
echo "π Build output summary:"
echo "Total files in dist: $(find dist -type f | wc -l)"
echo "Build size: $(du -sh dist | cut -f1)"
# Ensure executable permissions
chmod +x dist/index.js
echo "β
Executable permissions set"
- name: πΎ Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist/
retention-days: 7
# Job 3: Test
test:
name: π§ͺ Test
runs-on: ubuntu-latest
needs: quality # Only run if quality checks pass
strategy:
matrix:
node-version: [18, 20, 22] # Test on multiple Node versions
steps:
- name: π₯ Checkout code
uses: actions/checkout@v5
- name: π¦ Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: π Install dependencies
run: |
echo "π¦ Installing dependencies..."
npm ci
echo "β
Dependencies installed"
- name: π§ͺ Run tests
run: |
echo "π§ͺ Running tests on Node.js ${{ matrix.node-version }}..."
npm test
echo "β
All tests passed!"
- name: π Generate coverage report
if: matrix.node-version == 22 # Only on latest Node
run: |
echo "π Generating coverage report..."
npm run test:coverage || true
# Display coverage summary
if [ -f coverage/coverage-summary.json ]; then
echo "π Coverage Summary:"
node -e "
const coverage = require('./coverage/coverage-summary.json');
const total = coverage.total;
console.log('Lines:', total.lines.pct + '%');
console.log('Statements:', total.statements.pct + '%');
console.log('Functions:', total.functions.pct + '%');
console.log('Branches:', total.branches.pct + '%');
"
fi
- name: π€ Upload coverage reports
if: matrix.node-version == 22
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
retention-days: 30
# Job 4: Summary
summary:
name: π PR Summary
runs-on: ubuntu-latest
needs: [quality, build, test]
if: always() # Run even if other jobs fail
steps:
- name: π Create summary
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "# π Pull Request Check Summary" >> $GITHUB_STEP_SUMMARY
else
echo "# π Branch Check Summary (${{ github.ref_name }})" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
# Quality checks
if [[ "${{ needs.quality.result }}" == "success" ]]; then
echo "β
**Code Quality**: Passed" >> $GITHUB_STEP_SUMMARY
else
echo "β **Code Quality**: Failed" >> $GITHUB_STEP_SUMMARY
fi
# Build
if [[ "${{ needs.build.result }}" == "success" ]]; then
echo "β
**Build**: Successful" >> $GITHUB_STEP_SUMMARY
elif [[ "${{ needs.build.result }}" == "skipped" ]]; then
echo "βοΈ **Build**: Skipped (quality checks failed)" >> $GITHUB_STEP_SUMMARY
else
echo "β **Build**: Failed" >> $GITHUB_STEP_SUMMARY
fi
# Tests
if [[ "${{ needs.test.result }}" == "success" ]]; then
echo "β
**Tests**: All passed" >> $GITHUB_STEP_SUMMARY
elif [[ "${{ needs.test.result }}" == "skipped" ]]; then
echo "βοΈ **Tests**: Skipped (quality checks failed)" >> $GITHUB_STEP_SUMMARY
else
echo "β **Tests**: Failed" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "## π Next Steps" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.quality.result }}" != "success" ]]; then
echo "1. Fix code quality issues (run \`npm run format\` and \`npm run lint\`)" >> $GITHUB_STEP_SUMMARY
elif [[ "${{ needs.build.result }}" != "success" ]] && [[ "${{ needs.build.result }}" != "skipped" ]]; then
echo "1. Fix build errors" >> $GITHUB_STEP_SUMMARY
elif [[ "${{ needs.test.result }}" != "success" ]] && [[ "${{ needs.test.result }}" != "skipped" ]]; then
echo "1. Fix failing tests" >> $GITHUB_STEP_SUMMARY
else
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "π All checks passed! Your PR is ready for review." >> $GITHUB_STEP_SUMMARY
else
echo "π All checks passed! The ${{ github.ref_name }} branch is healthy." >> $GITHUB_STEP_SUMMARY
fi
fi
- name: π¬ Comment on PR
if: (failure() || cancelled()) && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const summary = [];
// Add header
summary.push('## π PR Check Results\n');
// Quality checks
if ('${{ needs.quality.result }}' === 'failure') {
summary.push('### β Code Quality Issues\n');
summary.push('Please fix the following:');
summary.push('- Run `npm run format` to fix formatting issues');
summary.push('- Run `npm run lint` to see linting errors\n');
}
// Build
if ('${{ needs.build.result }}' === 'failure') {
summary.push('### β Build Failed\n');
summary.push('The TypeScript build failed. Please check the build logs.\n');
}
// Tests
if ('${{ needs.test.result }}' === 'failure') {
summary.push('### β Tests Failed\n');
summary.push('Some tests are failing. Please check the test logs.\n');
}
if (summary.length > 1) {
summary.push('---');
summary.push('π‘ **Tip**: Click on the job names above to see detailed logs.');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: summary.join('\n')
});
}