Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): fix codemod tests #47710

Merged
merged 8 commits into from
Mar 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -671,25 +672,23 @@ jobs:
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
run: sudo ethtool -K eth0 tx off rx off

- uses: actions/cache@v3
timeout-minutes: 5
if: ${{ needs.build.outputs.docsChange == 'nope' }}
if: ${{ needs.build.outputs.codemodChange == 'yep' }}
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-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: Test if changes were found
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.codemodChange == 'yup' }}

testIntegration:
name: Test Integration
Expand Down Expand Up @@ -1173,6 +1172,10 @@ jobs:

- run: echo "${{ steps.docs-chang.outputs.DOCS_CHANGE }}"

- name: Check codemod only change
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: codemod-change
ijjk marked this conversation as resolved.
Show resolved Hide resolved

- name: Install
if: ${{ steps.docs-chang.outputs.DOCS_CHANGE != 'yep' }}
uses: actions-rs/toolchain@v1
Expand Down