ci(github): adds workflows for docker build and and tests (#44) #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Will eventually close out #44.
Tests
Backstop
Docker
A note on Docker and Playwright — to test an image built on GitHub, it seems one must make
npm
run asroot
, set777
permissions on/root
and/opt/pw-browsers
, reinstall playwright the long way.In the future I'll make adjustments to the
Dockerfile
so the workflow doesn't need to overrideentrypoint
. You can see the full, long-form command in.github/workflows/docker-smoke-test.yml
and.github/workflows/docker-sanity-test.yml
.Various categories of tests have their own workflow, run independently, or together in a reusable workflow. Bringing them all together:
This is a good first step towards a PR-checks workflow, which can run against any fork PRs to the upstream. For example, here arehttps://github.com/dgrebb/BackstopJS/pull/45/checks the PR checks run against this feature.
Docker Build Artifacts
The docker build workflow initializes the builder, builds the image, tags it as the fork/branch-name (for PR testing purposes), and pushes it to GHCR.
An example of the final workflow-built and pushed container can be seen here. Any fork's workflow-created images will remain unique to their owner.