ci(github): adds github workflows for CI/CD (#44) #1526
Merged
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.
GitHub Actions (#44)
In a separate branch, I created some GitHub actions and workflows. Happy to submit a PR with those changes as well. And do a walkthrough if you're curious :)
Tests
Backstop
Docker
A note on Docker and Playwright — to test an image built on GitHub, it seems one must makenpm
run asroot
, set777
permissions on/root
and/opt/pw-browsers
, reinstall playwright the long way.In the future I'll make adjustments to theDockerfile
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
.The above was resolved in #1523
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 are the PR and checks run against this feature in my fork.
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.
Docker Tests
All Docker-specific workflows are currently re-installing Playwright by overriding the
entrypoint
. This had to be done while using the untouched Dockerfile to build this all out. The new Dockerfile in the PR for #34 includesnpx playwright install --with-deps
to avoid this moving forward.