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

Add GitHub Action to deploy and test the plugin in a target environment #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GiuseppeArcifa
Copy link

Proposed changes

See: PRESS0-1986

This PR introduces a new GitHub Action workflow to automate the deployment and testing of the plugin in a specified environment.

The workflow follows these steps:

  • Install all dependencies (Node and Composer)
  • Build the plugin
  • Create the ZIP archive
  • Copy the ZIP file to the remote server
  • Install and activate the plugin via WP-CLI
  • Check if the remote URL is accessible
  • Run the specified Cypress tests on the remote installation

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Video

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@GiuseppeArcifa
Copy link
Author

Note: before merging the PR we can change the tests that will be run while its execution and the environments.

At the moment the Cypress test that will be ran is just one from the integration folder that perform simple checks.
While or the environment the only one at the moment is the bluehost-shared, we can setup multiple environments for staging / production / test purposes.

Both changes can be done just editing the deploy-and-test.yml file and then configuring the secrets and variables in the specific GitHub Repository environments

Copy link
Member

@wpscholar wpscholar left a comment

Choose a reason for hiding this comment

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

Looks good. Once we get this deployed, we'll start writing some live tests for onboarding.

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
Copy link
Member

Choose a reason for hiding this comment

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

We should update this to use Node 20, like the plugin does. See https://github.com/newfold-labs/wp-plugin-bluehost/blob/main/.nvmrc

Copy link
Author

Choose a reason for hiding this comment

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

updated to use Node v20

- name: Cleanup SSH Key
run: rm -f github-actions

- name: Wait for Server to be Ready
Copy link
Member

Choose a reason for hiding this comment

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

We should add a note here about the purpose of this waiting.

Copy link
Author

Choose a reason for hiding this comment

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

Updated the name of the Step in "Check if the remote Server is up" as it just checks if the site_url in which should be run the cypress test is reachable

@circlecube circlecube added this to the March 5, 2025 Release milestone Feb 24, 2025
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