Repository navigation
Run the tests in CI before deploying, like BioSpex - #89
Merged
Merged
Conversation
Add tests.yml for pull requests and as the first job of every deploy, move the duplicated build-and-deploy job into deploy-environment.yml, trust the servers through a committed known_hosts file, run one deploy at a time per branch, generate release notes from merged pull requests, and add Dependabot. The tests call withoutMix() so they pass before assets are built.
10 tasks
The response cache defaults to the Redis store, so the tests failed on the CI runner, which has no Redis. Disable it and use the array store in phpunit.xml.
Registering sends a verification email. With MAIL_MAILER=smtp the test needed a mail server on 127.0.0.1:1025, which the CI runner doesn't have.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #88.
Brings CI in line with BioSpex (AustinMastLab/Biospex#524, AustinMastLab/Biospex#531): the tests run on pull requests and before every deploy, and production and development share one deploy workflow.
tests.yml(new): runs on pull requests intomainanddevelopment, and is called bydeploy.yml.test: PHP 8.5, Composer download cache, createsstorage/framework(not in git), generates anAPP_KEYfor the run, Pint on the changed files (pull requests only), thenvendor/bin/pest --compact. SQLite in memory comes fromphpunit.xml.audit:composer audit --locked, pull requests only. It reports but never blocks a deploy.phpunit.xml: the tests no longer depend on services the CI runner doesn't have:RESPONSE_CACHE_ENABLED=falseandRESPONSE_CACHE_DRIVER=array. The response cache defaults to the Redis store, so the first CI run failed withConnection refused.MAIL_MAILER=arrayinstead ofsmtp. Registration sends a verification email, which needed a mail server on127.0.0.1:1025.Locally they passed only because Redis and a mail catcher are running.
tests/TestCase.php: callswithoutMix(). CI runs the tests before assets are built, and without it 21 tests failed in a clean checkout on "Mix manifest not found" (pages returned 500, which also failed the login, registration and password-reset tests). With it, a fresh clone passes the same 48 tests (2 skipped) as a local checkout.deploy-environment.yml(new): the build-and-deploy job, once, with anenvironmentinput. Same steps as before (IP allow-list and revoke, PHP, Composer, Yarn andnpm run production, package, artifact, Deployer), except:vendor/..github/known_hosts, withStrictHostKeyChecking yes, instead ofssh-keyscanat deploy time. The file has both servers' ed25519, ECDSA and RSA keys; I checked them against the live servers.deploy.yml:testsjob that both deploysneed.[skip deploy]/[no deploy]skip it too.concurrencyper branch, never cancelling a deploy in progress.HEAD.gh release create --generate-notesfrom the previous release, so the notes list the merged pull requests instead of the merge commit message.dependabot.yml(new): weekly pull requests intodevelopmentfor GitHub Actions (one grouped PR), Composer and npm (minor and patch grouped, at most 5 open each).README: describes the tests, the shared workflow, the known-hosts file and Dependabot.
After merging:
developmentafter fast-forwarding it: tests, then a deploy with host-key checking on.testcheck as required in themainruleset.