Impact Analysis Report #10
This file contains 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: Impact Report | |
on: | |
workflow_dispatch: | |
inputs: | |
package_manager: | |
description: 'Package Manager' | |
required: true | |
type: choice | |
options: | |
- npm | |
default: 'npm' | |
package_name: | |
description: 'Package Name' | |
required: true | |
type: string | |
jobs: | |
impact: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout depsweep code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Build depsweep | |
run: | | |
npm install | |
npm run build | |
- name: Verify build output | |
run: ls -l dist | |
- name: Create test directory | |
run: | | |
mkdir test-package | |
cd test-package | |
npm init -y | |
npm install ${{ github.event.inputs.package_name }} --verbose | |
- name: Debug install | |
run: ls -l test-package/node_modules/${{ github.event.inputs.package_name }} | |
- name: Run depsweep | |
working-directory: test-package | |
run: | | |
echo "Node version: $(node --version)" | |
echo "NPM version: $(npm --version)" | |
pwd | |
ls -la | |
ls -la ../dist | |
node --trace-warnings ../dist/index.js --measure-impact="node_modules/${{ github.event.inputs.package_name }}" 2>../error.log > ../output.txt || { | |
echo "Error running depsweep. Error log:" | |
cat ../error.log | |
echo "Package contents:" | |
ls -R node_modules/${{ github.event.inputs.package_name }} | |
echo "Output log:" | |
cat ../output.txt | |
exit 1 | |
} | |
echo '```' >> ../$GITHUB_STEP_SUMMARY | |
cat ../output.txt >> ../$GITHUB_STEP_SUMMARY | |
echo '```' >> ../$GITHUB_STEP_SUMMARY |