This document describes how to set up and use the CI/CD pipeline for Meowwright using Google Cloud Build.
The CI/CD pipeline is configured to:
- Install Node.js dependencies
- Install Playwright browsers (Chromium)
- Run Playwright tests
- Upload test reports and artifacts to Google Cloud Storage
Before you can use the CI/CD pipeline, you need to:
- Create a Google Cloud Platform (GCP) account if you don't have one
- Create a new project in GCP
- Enable the Cloud Build API
- Create a Cloud Storage bucket for test reports and artifacts
- Set up appropriate permissions
- Go to the Cloud Storage section in your GCP console
- Click "Create Bucket"
- Name your bucket (e.g., "meowwright-test-results")
- Choose your settings for location, storage class, etc.
- Click "Create"
Update the _BUCKET_NAME substitution variable in the cloudbuild.yaml file to match your bucket name:
substitutions:
_BUCKET_NAME: 'meowwright-test-results'- Go to the Cloud Build section in your GCP console
- Click "Triggers"
- Click "Connect Repository"
- Select your repository provider (GitHub, Bitbucket, etc.)
- Authenticate and select your repository
- Click "Connect"
- In the Cloud Build Triggers section, click "Create Trigger"
- Name your trigger (e.g., "Meowwright Tests")
- Select your repository
- Set the trigger event (e.g., push to a branch, pull request)
- Set the source to the branch you want to trigger builds from
- Set the configuration to "Cloud Build configuration file (yaml or json)"
- Set the location to "Repository" and the path to "cloudbuild.yaml"
- Click "Create"
You can also run the pipeline manually:
- Go to the Cloud Build section in your GCP console
- Click "Triggers"
- Find your trigger and click "Run Trigger"
- Select the branch you want to build
- Click "Run"
After a build completes:
- Go to the Cloud Build section in your GCP console
- Click "History"
- Click on the build you want to view
- You can see the build logs and steps
- To view test reports, go to your Cloud Storage bucket and navigate to the reports folder
You can customize the pipeline by editing the cloudbuild.yaml file:
- Add additional steps for linting, security scanning, etc.
- Change the machine type for better performance
- Adjust timeouts
- Add notifications
If you encounter issues with the pipeline:
- Check the build logs in Cloud Build
- Verify that your Cloud Storage bucket exists and is accessible
- Ensure that Cloud Build has the necessary permissions
- Check that your repository is properly connected to Cloud Build