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 workflow for verifying pact tests #7094

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

kevindew
Copy link
Member

Trello: https://trello.com/c/QrxjshEm/270-move-ruby-gems-from-jenkins-to-github-actions

This moves the pact verification to a GitHub Action and will no longer be performed by a Jenkins build. This workflow will also be called by GDS API Adapters as part of its CI build to assert that newly generated pacts are valid against this app. To avoid running this same task twice pact:verify is no longer part of the Jenkins test actions and instead the other rake default steps are included.

For more details see alphagov/gds-api-adapters#1175

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

This moves the pact verification to a GitHub Action and will no longer
be performed by a Jenkins build. This workflow will also be called by
GDS API Adapters as part of it's CI build to assert that newly generated
pacts are valid against this app. To avoid running this same task twice
`pact:verify` is no longer part of the Jenkins test actions and instead
the other rake default steps are included.

For more details see alphagov/gds-api-adapters#1175
@@ -15,7 +15,7 @@ node {
echo "Running a subset of the tests to check the content schema changes"
govuk.runRakeTask("test:publishing_schemas --trace")
} else {
sh("bundle exec rake")
sh("bundle exec rake lint test cucumber jasmine")
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm I understand why you haven't just removed pact:verify from the default task (devs should be able to run the full test suite locally), but I think it would be cleaner to define a new Rake task that encapsulates the above, e.g.

task ci: %i[lint test cucumber jasmine] # Pact tests run separately on GitHub Actions

And then changing this to:

Suggested change
sh("bundle exec rake lint test cucumber jasmine")
sh("bundle exec rake ci")

But not a blocker.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, this could work but may need some refinement.

I don't like the idea of it being ci as pact:verify will be also a part of CI. Could call it jenkins_ci, but that couples it to Jenkins. I suppose could be ci_build hmmm. I also wonder if it's actually better to be direct in the Jenkinsfile and whether adding another task ends up being misdirection.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair point 👍 happy to leave as-is.

@kevindew kevindew merged commit b802979 into main Nov 30, 2022
@kevindew kevindew deleted the pact-github-actions branch November 30, 2022 10:06
kevindew added a commit that referenced this pull request Nov 30, 2022
Realised I should have added this in: #7094
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.

2 participants