Skip to content

Fix connection drag placeholder positioning and custom SVG routing #4034

Fix connection drag placeholder positioning and custom SVG routing

Fix connection drag placeholder positioning and custom SVG routing #4034

Workflow file for this run

name: 'build'
on: [push, pull_request]
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set Timezone
uses: szenius/set-timezone@v2.0
with:
timezoneLinux: 'UTC'
- name: Checkout (GitHub)
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- run: docker network create --driver bridge textit_default
- name: Set environment variables
run: |
echo "NYARUKA_HOME=$(dirname ${{ github.workspace }})" >> $GITHUB_ENV
echo "CONDUCTOR_HOME=/tmp/conductor" >> $GITHUB_ENV
mkdir -p /tmp/conductor/workspaces
- name: Build and run dev container task
id: validate
uses: devcontainers/ci@v0.3
with:
runCmd: |
yarn install && yarn validate 2>&1 | tee validate_output.log
exit ${PIPESTATUS[0]}
push: never
env: |
CI=true
- name: Extract coverage stats
if: success() || failure()
run: |
if [ -f validate_output.log ]; then
echo "Extracting coverage information from validate output..."
# Extract coverage report section
COVERAGE_REPORT=$(grep -A 10 "📊 Coverage Report" validate_output.log | head -15 || echo "Coverage report not found")
# Save coverage to environment file for PR comment
echo "COVERAGE_REPORT<<EOF" >> $GITHUB_ENV
echo "$COVERAGE_REPORT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
# Also save individual metrics for easier parsing
LINES_COVERAGE=$(grep "Lines:" validate_output.log | grep -o '[0-9.]*%' | tail -1 || echo "N/A")
FUNCTIONS_COVERAGE=$(grep "Functions:" validate_output.log | grep -o '[0-9.]*%' | tail -1 || echo "N/A")
BRANCHES_COVERAGE=$(grep "Branches:" validate_output.log | grep -o '[0-9.]*%' | tail -1 || echo "N/A")
echo "LINES_COVERAGE=$LINES_COVERAGE" >> $GITHUB_ENV
echo "FUNCTIONS_COVERAGE=$FUNCTIONS_COVERAGE" >> $GITHUB_ENV
echo "BRANCHES_COVERAGE=$BRANCHES_COVERAGE" >> $GITHUB_ENV
echo "Coverage extracted:"
echo "Lines: $LINES_COVERAGE"
echo "Functions: $FUNCTIONS_COVERAGE"
echo "Branches: $BRANCHES_COVERAGE"
# Debug: show what coverage files we have
echo "Available coverage files:"
find . -name "coverage" -type d 2>/dev/null || echo "No coverage directories found"
find . -name "lcov-report" -type d 2>/dev/null || echo "No lcov-report directories found"
else
echo "No validate output found"
fi
- name: Comment coverage on PR
if: github.event_name == 'pull_request' && (success() || failure())
uses: actions/github-script@v7
with:
script: |
const coverageReport = process.env.COVERAGE_REPORT;
const linesCoverage = process.env.LINES_COVERAGE;
const functionsCoverage = process.env.FUNCTIONS_COVERAGE;
const branchesCoverage = process.env.BRANCHES_COVERAGE;
const body = `## 📊 Coverage Report
\`\`\`
${coverageReport}
\`\`\`
### Summary
- **Lines:** ${linesCoverage}
- **Functions:** ${functionsCoverage}
- **Branches:** ${branchesCoverage}
[Coverage Report](https://s3.us-east-1.amazonaws.com/dev.temba.io/coverage/temba-components/pr-${context.payload.number}/index.html)
`;
// Find existing coverage comment
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
});
const existingComment = comments.data.find(comment =>
comment.user.login === 'github-actions[bot]' &&
comment.body.includes('📊 Coverage Report')
);
if (existingComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body: body
});
} else {
// Create new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
body: body
});
}
- name: Configure AWS credentials
if: success() || failure()
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload coverage report to S3
if: success() || failure()
run: |
# Check if coverage directory exists
if [ -d "coverage/lcov-report" ]; then
echo "Uploading coverage report to S3..."
if [ "${{ github.event_name }}" == "pull_request" ]; then
# For PRs, upload to a PR-specific folder
S3_PATH="s3://dev.temba.io/coverage/temba-components/pr-${{ github.event.number }}/"
else
# For main branch, upload to main folder
S3_PATH="s3://dev.temba.io/coverage/temba-components/main/"
fi
aws s3 sync coverage/lcov-report/ "$S3_PATH" --delete
echo "Coverage report uploaded to: $S3_PATH"
else
echo "No coverage report found to upload"
fi
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: screenshots
path: screenshots/