Unverified Commit 2513965f authored by Steven's avatar Steven Committed by GitHub

chore(ci): add job to test codemods (#46068)

This PR ensures the tests for codemods will automatically run in CI when the source code changes.
Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
parent ce46922b
......@@ -527,6 +527,36 @@ jobs:
path: |
test/traces
testCodemods:
name: Test Codemods
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 5
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- 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<<EOF" >> $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-focal /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v16 | 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' }}
testIntegration:
name: Test Integration
runs-on: ubuntu-latest
......
......@@ -35,6 +35,7 @@ const CHANGE_ITEM_GROUPS = {
'packages/next-env/README.md',
],
cna: ['packages/create-next-app', 'test/integration/create-next-app'],
'next-codemod': ['packages/next-codemod'],
'next-swc': [
'packages/next-swc',
'scripts/normalize-version-bump.js',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment