@@ -38,35 +38,45 @@ jobs:
3838 cache : ' npm'
3939 - name : docs
4040 run : make docs
41+
4142 test :
4243 runs-on : ubuntu-latest
4344 steps :
4445 - uses : actions/checkout@master
46+
4547 - uses : actions/setup-node@v3
4648 with :
4749 node-version : 20
4850 cache : ' npm'
51+
4952 - name : install
5053 run : make install
54+
5155 - name : build
5256 run : make build
57+
5358 - name : test
5459 env :
55- NODE_OPTIONS : " --max_old_space_size=4096"
60+ NODE_OPTIONS : ' --max_old_space_size=4096'
5661 run : make test-coverage
62+
5763 - name : test-cli
5864 run : make test-cli
65+
5966 - name : test-inspector
6067 env :
61- NODE_OPTIONS : " --max_old_space_size=4096"
68+ NODE_OPTIONS : ' --max_old_space_size=4096'
6269 run : make test-inspector
70+
6371 - uses : codecov/codecov-action@v3
6472 if : always()
6573 with :
6674 fail_ci_if_error : false # optional (default = false)
6775 verbose : true # optional (default = false)
76+
6877 - name : prepare releasable packages
6978 run : make prepare
79+
7080 test-e2e :
7181 needs : [notify_deployment]
7282 runs-on : ubuntu-latest
90100 run : cd packages/@dcl/inspector && npm i && cd ../../../
91101 - name : test-inspector E2E
92102 env :
93- NODE_OPTIONS : " --max_old_space_size=4096"
103+ NODE_OPTIONS : ' --max_old_space_size=4096'
94104 run : E2E_URL=https://${{steps.get-cloudflare-url.outputs.result}}/inspector make test-inspector-e2e
105+
95106 build :
96107 runs-on : ubuntu-latest
97108 permissions :
@@ -110,7 +121,6 @@ jobs:
110121 node-version : 20
111122 cache : ' npm'
112123
113-
114124 - name : install
115125 run : make install
116126
@@ -447,3 +457,104 @@ jobs:
447457 env :
448458 AWS_ACCESS_KEY_ID : ${{ secrets.SDK_TEAM_AWS_ID }}
449459 AWS_SECRET_ACCESS_KEY : ${{ secrets.SDK_TEAM_AWS_SECRET }}
460+
461+ check-local-deps :
462+ name : Check for development dependencies
463+ needs : [build]
464+ runs-on : ubuntu-latest
465+ if : >
466+ (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main') ||
467+ github.ref == 'refs/heads/main'
468+
469+ steps :
470+ - uses : actions/checkout@v3
471+
472+ - uses : actions/setup-node@v3
473+ with :
474+ node-version : 20
475+
476+ - name : Download prepared packages
477+ uses : actions/download-artifact@v4
478+ with :
479+ name : built-artifacts
480+ path : downloaded-packages
481+
482+ - name : Set up artifacts for checking
483+ run : |
484+ echo "Setting up built artifacts for checking..."
485+ mkdir -p extracted-packages
486+
487+ # Extract all packages to separate directories
488+ find downloaded-packages -type f -name "*.tgz" | while read pkg; do
489+ if [ -f "$pkg" ]; then
490+ # Get package name from the filename
491+ pkg_name=$(basename "$pkg" .tgz)
492+
493+ # Create directory for this package
494+ mkdir -p "extracted-packages/$pkg_name"
495+
496+ echo "Extracting $pkg to extracted-packages/$pkg_name"
497+ tar -xzf "$pkg" -C "extracted-packages/$pkg_name"
498+ fi
499+ done
500+
501+ # List all extracted packages
502+ echo "Extracted packages:"
503+ find extracted-packages -name "package.json" | sort
504+
505+ - name : Check for local package dependencies
506+ id : dependency-check
507+ continue-on-error : true
508+ run : |
509+ set +e
510+ node .github/scripts/check-no-local-packages.cjs ./extracted-packages > check-output.txt 2>&1
511+ check_exit_code=$?
512+ set -e
513+
514+ echo "Full output from dependency check:"
515+ cat check-output.txt
516+
517+ if [ $check_exit_code -ne 0 ]; then
518+ grep -i "dependency " check-output.txt > dependency-errors.txt || echo "No specific dependency errors found" > dependency-errors.txt
519+ if [ ! -s dependency-errors.txt ]; then
520+ echo "⚠️ No specific dependency errors found" > dependency-errors.txt
521+ fi
522+ exit 1
523+ fi
524+
525+ - name : Generate comment content
526+ if : steps.dependency-check.outcome == 'failure'
527+ run : |
528+ echo "## ⚠️ Local Dependencies Detected" >> dependency-check-comment.md
529+ echo "This PR contains package dependencies that use local paths (\`file:\`) or non-allowed URLs (\`http:\`, \`https:\`, \`git:\`)." >> dependency-check-comment.md
530+ echo "These must be published and referenced properly before merging." >> dependency-check-comment.md
531+ echo "### Not allowed dependencies:" >> dependency-check-comment.md
532+ echo '```' >> dependency-check-comment.md
533+ cat dependency-errors.txt >> dependency-check-comment.md
534+ echo '```' >> dependency-check-comment.md
535+ echo "Review the workflow logs for more details." >> dependency-check-comment.md
536+ echo "> **Note:** This comment is automatically updated when the PR is updated." >> dependency-check-comment.md
537+
538+ - name : Find Local Dependencies Comment if check fails
539+ if : ${{ github.event_name == 'pull_request' && steps.dependency-check.outcome == 'failure' }}
540+ uses : peter-evans/find-comment@v3
541+ id : fc-local-deps
542+ with :
543+ issue-number : ${{ github.event.pull_request.number }}
544+ comment-author : ' github-actions[bot]'
545+ body-includes : Local Dependencies Detected
546+
547+ - name : Create or update Local Dependencies Comment if check fails
548+ if : ${{ github.event_name == 'pull_request' && steps.dependency-check.outcome == 'failure' }}
549+ uses : peter-evans/create-or-update-comment@v4
550+ with :
551+ comment-id : ${{ steps.fc-local-deps.outputs.comment-id }}
552+ issue-number : ${{ github.event.pull_request.number }}
553+ body-path : dependency-check-comment.md
554+ edit-mode : replace
555+
556+ - name : Fail check if local dependencies found
557+ if : steps.dependency-check.outcome == 'failure'
558+ run : |
559+ echo "❌ Local package dependencies detected! These must be fixed before merging."
560+ exit 1
0 commit comments