Skip to content

Conversation

@pranavz28
Copy link
Contributor

@pranavz28 pranavz28 commented Oct 7, 2025

This pull request introduces a new GitHub Actions workflow to automate dependency updates for both Node and Python environments, and integrates visual regression testing using Percy Web. The workflow runs weekly and on demand, automatically bumps dependencies, creates a pull request if changes are detected, and runs Percy Web tests on the update branch. It also provides feedback on the status of Percy builds directly in the pull request.

Automated Dependency Management

  • Adds a scheduled workflow (.github/workflows/dependency-update.yml) that updates Node (via npm-check-updates) and Python dependencies (via pip), and ensures the latest stable version of @percy/cli is installed.
  • Automatically creates a pull request with updated dependencies and a summary of changes if any updates are detected.

Percy Web Integration

  • Runs Percy Web visual regression tests on the dependency update pull request branch, using the latest dependencies and browsers installed via Playwright.
  • Comments on the pull request with the result of the Percy Web run, including build URLs and error details if applicable.
  • Uploads Percy Web logs as workflow artifacts for debugging and traceability.

@pranavz28 pranavz28 requested a review from a team as a code owner October 7, 2025 10:53
Refactor GitHub Actions workflow for dependency updates. Simplify job structure, improve naming conventions, and enhance logging.
Comment on lines +91 to +103
- name: Install Node deps (PR branch)
if: ${{ steps.cpr.outputs.pull-request-number != '' }}
run: |
npm ci || npm install

- name: Re-create venv & install Python deps (PR branch)
if: ${{ steps.cpr.outputs.pull-request-number != '' }}
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is repeated, can we optimise this. Check if we can use cache here? Something like
uses: actions/cache@v4, This will decrease the run time almost by 1-2 minute.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a condition to check if the requirements exists

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a pull request exists, still this is redundant right ???

if: ${{ steps.cpr.outputs.pull-request-number == '' }}
run: |
echo "No changes detected; no PR opened. Skipping Percy run."
echo "pr_created=0" >> $GITHUB_OUTPUT

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pr_created value is not used anywhere in the later code, is it required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

});

- name: Upload Percy logs
if: always() && ${{ steps.cpr.outputs.pull-request-number != '' }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: always() && ${{ steps.cpr.outputs.pull-request-number != '' }}
if: always() && steps.cpr.outputs.pull-request-number != ''

The statement inside of if is always treated as expression -- Check if we can use ^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@Shivanshu-07
Copy link

@pranavz28 have you tested this workflow? https://github.com/percy/example-percy-playwright-python/actions/runs/18311215267/workflow -> This workflow is failing, please check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants