diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 63e2da47fff9f..df71e5c4c4741 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -35,6 +35,7 @@ jobs: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} outputs: docsChange: ${{ steps.docs-change.outputs.DOCS_CHANGE }} + codemodChange: ${{ steps.codemod-change.outputs.CODEMOD_CHANGE }} isRelease: ${{ steps.check-release.outputs.IS_RELEASE }} swcChange: ${{ steps.swc-change.outputs.SWC_CHANGE }} turboToken: ${{ steps.turbo-token.outputs.TURBO_TOKEN }} @@ -61,6 +62,12 @@ jobs: - run: echo "${{steps.docs-change.outputs.DOCS_CHANGE}}" + - name: Check codemod change + run: echo "CODEMOD_CHANGE<> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --type next-codemod --exec echo 'yup')" >> $GITHUB_OUTPUT; echo 'EOF' >> $GITHUB_OUTPUT + id: codemod-change + + - run: echo "${{steps.codemod-change.outputs.CODEMOD_CHANGE}}" + - run: echo "SWC_CHANGE<> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --type next-swc --exec echo 'yup')" >> $GITHUB_OUTPUT; echo 'EOF' >> $GITHUB_OUTPUT id: swc-change @@ -665,13 +672,14 @@ jobs: name: Test Codemods runs-on: ubuntu-latest needs: [build] + if: ${{ needs.build.outputs.codemodChange == 'yup' }} timeout-minutes: 5 env: NEXT_TELEMETRY_DISABLED: 1 TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }} steps: - - run: echo "${{needs.build.outputs.docsChange}}" + - run: echo "${{needs.build.outputs.codemodChange}}" # https://github.com/actions/virtual-environments/issues/1187 - name: tune linux network @@ -679,17 +687,13 @@ jobs: - uses: actions/cache@v3 timeout-minutes: 5 - if: ${{ needs.build.outputs.docsChange == 'nope' }} id: restore-build with: path: ./* key: ${{ github.sha }}-${{ github.run_number }} - - run: echo "CODEMOD_CHANGE<> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --type next-codemod --always-canary --exec echo 'yup')" >> $GITHUB_OUTPUT; echo "EOF" >> $GITHUB_OUTPUT - id: codemodChange - - - run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ env.NODE_LTS_VERSION }} | FORCE=1 bash && npm i -g pnpm@${PNPM_VERSION} > /dev/null && cd ./packages/next-codemod && pnpm build && pnpm test >> /proc/1/fd/1" - if: ${{ needs.build.outputs.docsChange == 'nope' && steps.codemodChange.outputs.CODEMOD_CHANGE == 'yup' }} + - name: Run tests + run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ env.NODE_LTS_VERSION }} | FORCE=1 bash && npm i -g pnpm@${PNPM_VERSION} > /dev/null && cd ./packages/next-codemod && pnpm build && pnpm test >> /proc/1/fd/1" testIntegration: name: Test Integration diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 352c979767399..aec9d395c9240 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -2,6 +2,11 @@ "name": "@next/codemod", "version": "13.2.5-canary.22", "license": "MIT", + "repository": { + "type": "git", + "url": "vercel/next.js", + "directory": "packages/next-codemod" + }, "dependencies": { "chalk": "4.1.0", "cheerio": "1.0.0-rc.9",