chore: bump node-libcurl for electron 43 and windows arm support [INS-3111] #24971
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test App | |
| on: | |
| merge_group: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - develop | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| Test: | |
| timeout-minutes: 20 | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| packages: read | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@kong' | |
| - name: Install packages | |
| run: npm ci | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' | |
| - name: Lint | |
| run: npm run lint | |
| - name: Type checks | |
| run: npm run type-check | |
| - name: Unit Tests | |
| run: npm test | |
| - name: Check autocomplete snippets are up to date | |
| run: | | |
| npm run generate:autocomplete -w insomnia-scripting-environment | |
| if ! git diff --exit-code packages/insomnia-scripting-environment/src/autocomplete-snippets.json; then | |
| echo "::error::autocomplete-snippets.json is out of date. Run 'npm run generate:autocomplete -w insomnia-scripting-environment' and commit the result." | |
| exit 1 | |
| fi | |
| - name: Check Insomnia JSON schema is up to date | |
| run: | | |
| npm run generate:schema -w insomnia | |
| # `git add -N` marks any newly-generated versioned file (e.g. after a | |
| # schema version bump) as intent-to-add so `git diff` flags it too. | |
| git add -N schemas/ | |
| if ! git diff --exit-code schemas/; then | |
| echo "::error::schemas/ is out of date. Run 'npm run generate:schema -w insomnia' and commit the result." | |
| exit 1 | |
| fi | |
| - name: Install sandbox-vendored packages and check pins never exceed app versions | |
| run: npm run sandbox:vendored:ci -w insomnia | |
| - name: Check sandbox-vendored bundles are up to date | |
| run: | | |
| npm run sandbox:vendored:generate -w insomnia | |
| if ! git diff --exit-code packages/insomnia/src/templating/sandbox/vendored/*.generated.ts; then | |
| echo "::error::Sandbox-vendored bundles are out of date or hand-edited. Run 'npm run sandbox:vendored:ci -w insomnia && npm run sandbox:vendored:generate -w insomnia' and commit the result." | |
| exit 1 | |
| fi | |
| - name: Check for sandbox-vendored changes | |
| id: vendor-changed | |
| if: github.event_name == 'pull_request' | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| run: | | |
| git fetch origin "$BASE_SHA" --depth=1 | |
| if git diff --name-only "$BASE_SHA"...HEAD | grep -qE '^packages/insomnia/src/templating/sandbox/(vendored/(pkg/|.*\.generated\.ts$)|module-registry\.ts$)'; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Sandbox-vendored regression suite | |
| if: github.event_name != 'pull_request' || steps.vendor-changed.outputs.changed == 'true' | |
| run: npm run sandbox:vendored:test-regression -w insomnia | |
| - name: Checkout base branch (cycle comparison) | |
| if: github.event_name == 'pull_request' && always() | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.base.ref }} | |
| path: insomnia-base | |
| - name: Setup Node (base branch tree) | |
| if: github.event_name == 'pull_request' && always() | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version-file: insomnia-base/.nvmrc | |
| cache: npm | |
| cache-dependency-path: insomnia-base/package-lock.json | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@kong' | |
| - name: Install packages (base branch tree) | |
| if: github.event_name == 'pull_request' && always() | |
| working-directory: insomnia-base | |
| run: npm ci | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' | |
| - name: Check Circular References | |
| if: github.event_name == 'pull_request' && always() | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const path = require('path'); | |
| const workspaceRoot = process.env.GITHUB_WORKSPACE; | |
| const prPackagesDir = path.join(workspaceRoot, 'packages'); | |
| const basePackagesDir = path.join(workspaceRoot, 'insomnia-base', 'packages'); | |
| async function analyzeCircularReferences(rootDir) { | |
| const madge = require('madge'); | |
| const res = await madge(rootDir, { | |
| fileExtensions: ['ts', 'tsx'], | |
| }); | |
| return res.circular(); | |
| } | |
| // Function to generate markdown report | |
| function generateMarkdownReport(prCircularRefs, baseCircularRefs, prCount, baseCount, baseBranch) { | |
| const timestamp = new Date().toISOString(); | |
| const diff = prCount - baseCount; | |
| const diffPercent = baseCount > 0 ? ((diff / baseCount) * 100).toFixed(2) : '0.00'; | |
| let status = '✅ PASSED'; | |
| let statusEmoji = '✅'; | |
| if (diff > 0) { | |
| status = '⚠️ WARNING'; | |
| statusEmoji = '⚠️'; | |
| } else if (diff === 0) { | |
| status = '✅ NO CHANGE'; | |
| statusEmoji = '✅'; | |
| } else { | |
| status = '✨ IMPROVED'; | |
| statusEmoji = '✨'; | |
| } | |
| // Find new and removed circular references | |
| const prCycleStrings = new Set(prCircularRefs.map(cycle => cycle.join(' -> '))); | |
| const baseCycleStrings = new Set(baseCircularRefs.map(cycle => cycle.join(' -> '))); | |
| const newCycles = Array.from(prCycleStrings).filter(cycle => !baseCycleStrings.has(cycle)).sort(); | |
| const removedCycles = Array.from(baseCycleStrings).filter(cycle => !prCycleStrings.has(cycle)).sort(); | |
| return `# ${statusEmoji} Circular References Report | |
| **Generated at:** ${timestamp} | |
| **Status:** ${status} | |
| ## Summary | |
| | Metric | Base (\`${baseBranch}\`) | PR | Change | | |
| |--------|----------------|-----|---------| | |
| | Total Circular References | ${baseCount} | ${prCount} | ${diff > 0 ? '+' : ''}${diff} (${diffPercent > 0 ? '+' : ''}${diffPercent}%) | | |
| ${newCycles.length > 0 ? ` | |
| ## ⚠️ New Circular References Added (${newCycles.length}) | |
| <details open> | |
| <summary>Click to expand/collapse</summary> | |
| \`\`\` | |
| ${newCycles.join('\n')} | |
| \`\`\` | |
| </details> | |
| ` : ''} | |
| ${removedCycles.length > 0 ? ` | |
| ## ✨ Circular References Removed (${removedCycles.length}) | |
| <details open> | |
| <summary>Click to expand/collapse</summary> | |
| \`\`\` | |
| ${removedCycles.join('\n')} | |
| \`\`\` | |
| </details> | |
| ` : ''} | |
| <details> | |
| <summary>Click to view all circular references in PR (${prCount})</summary> | |
| \`\`\` | |
| ${prCircularRefs.length > 0 ? prCircularRefs.sort().map(cycle => cycle.join(' -> ')).join('\n') : 'No circular references found'} | |
| \`\`\` | |
| </details> | |
| <details> | |
| <summary>Click to view all circular references in base branch (${baseCount})</summary> | |
| \`\`\` | |
| ${baseCircularRefs.length > 0 ? baseCircularRefs.sort().map(cycle => cycle.join(' -> ')).join('\n') : 'No circular references found'} | |
| \`\`\` | |
| </details> | |
| ## Analysis | |
| ${ | |
| diff > 0 | |
| ? `⚠️ **Warning:** This PR introduces ${diff} new circular ${diff === 1 ? 'reference' : 'references'}. Consider refactoring to avoid adding circular dependencies.` | |
| : diff < 0 | |
| ? `✨ **Great Job!** This PR removes ${Math.abs(diff)} circular ${Math.abs(diff) === 1 ? 'reference' : 'references'}. Keep up the good work!` | |
| : `✅ **No Change:** This PR does not introduce or remove any circular references.` | |
| } | |
| --- | |
| *This report was generated automatically by comparing against the \`${baseBranch}\` branch.* | |
| `; | |
| } | |
| try { | |
| const baseBranch = context.payload.pull_request.base.ref; | |
| console.log(`Base branch (PR target): ${baseBranch}`); | |
| console.log(`PR packages dir: ${prPackagesDir}`); | |
| console.log(`Base packages dir: ${basePackagesDir}`); | |
| console.log('Analyzing circular references in PR (merge) tree...'); | |
| const prCircularRefs = await analyzeCircularReferences(prPackagesDir); | |
| const prCount = prCircularRefs.length; | |
| console.log(`PR: Found ${prCount} circular references`); | |
| console.log(`Analyzing circular references in ${baseBranch} tree...`); | |
| const baseCircularRefs = await analyzeCircularReferences(basePackagesDir); | |
| const baseCount = baseCircularRefs.length; | |
| console.log(`Base: Found ${baseCount} circular references`); | |
| // Generate report | |
| const diff = prCount - baseCount; | |
| const markdownContent = generateMarkdownReport(prCircularRefs, baseCircularRefs, prCount, baseCount, baseBranch); | |
| // Post PR comment | |
| if (context.eventName === 'pull_request') { | |
| try { | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const botComment = comments.find(comment => | |
| comment.user?.type === 'Bot' && | |
| comment.body?.includes('# ') && | |
| comment.body?.includes('Circular References Report') | |
| ); | |
| if (botComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: botComment.id, | |
| body: markdownContent | |
| }); | |
| console.log('Updated existing PR comment'); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: markdownContent | |
| }); | |
| console.log('Created new PR comment'); | |
| } | |
| } catch (error) { | |
| console.error('Error posting PR comment:', error); | |
| } | |
| } | |
| // Log results but don't fail the build | |
| if (diff > 0) { | |
| console.log(`⚠️ Warning: This PR introduces ${diff} new circular ${diff === 1 ? 'reference' : 'references'}. Base: ${baseCount}, PR: ${prCount}`); | |
| } else if (diff < 0) { | |
| console.log(`✨ Great! This PR removes ${Math.abs(diff)} circular ${Math.abs(diff) === 1 ? 'reference' : 'references'}!`); | |
| } else { | |
| console.log(`✅ No change in circular references (${prCount})`); | |
| } | |
| } catch (error) { | |
| console.error('Error analyzing circular references:', error); | |
| core.setFailed('Failed to analyze circular references'); | |
| } |