Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run automated test of Sage Install Script (#113)
* adds a sage-test workflow * temporarily allow the test to run on any branch so we can see if it works * add to on push to test the test * pull terminus.phar from latest * authenticate with terminus * this is a github secret, not an environment variable * create a multidev for the build in a separate step need to add a no-input parameter for the install script * add a step to generate a name for our multidev based on the os, pr, and php version * use github.event.number * run a cleanup step that deletes the multidev * add an echo so we can save the output of the pr number * get the pr number a different way? * remove core const if already declared * echo the PR number? * echo all the things * use gh cli? * get the pr number the right way * explicitly set the shell to bash everywhere * set the default shell to bash and remove the definitions * if we're in a windows environment, how we install terminus differs add the current directory to the PATH variable so we can run terminus from where we downloaded it * Sage (and Bedrock) doesn't actually work on PHP 7.4 * remove windows tests terminus isn't technically supported on windows so this is kind of moot * install terminus from homebrew if macos * add a test that terminus works * add latest version back * shorten the test name * support values to be globally set * globally set values we might not actually need this if we're in the site directory... * clone down the site can't believe I went this long without realizing we're going to need to run this in an actual site directory * sync the latest changes to the test multidev * wrap sitename in quotes * install ssh key so we can clone * clone site before multidev creation if it's going to fail, let's fail before we wait for the multidev to be created * deal with pantheon ssh host keys * remove the ssh-keyscan step * need to set a git config before we can git things * make sure we're in the right directory * add a check for CI so we don't loop through the script * export our globals so they are read by the script * don't prompt for confirmation if ci * wait longer for CI since there are concurrent builds * move these to be global variables and add a siteenv variable * use siteenv anywhere we'd manually set .dev * define the SITEENV to the multidev name * lower the waittime to 300 i think 600 might be too much * wait for long running scripts but wait shorter but still vary it based on whether we're on ci or local * add colors * output that we're checking for jq * allow sed handing between linux and macos and bail if it fails * fix sed condition for shellcheck * print current working directory * sed conditional needs to go inside the ostype condition * add closing fi * add a check for the sage theme directory * move the git pull to after we push the post install cmd i think this isn't actually getting pushed * remove random + that must've been a typo * sitename.siteenv * halve the waittime yet again * push to the right branch * only try opening the site if we're not in ci * wrap $branch in quotes * remove composer install step we do this again later inside the multidev that we clone down, so there's no reason to do this before we create the multidev * break terminus stuff up into multiple steps * delete sage theme if it exists * composer install after copying updates from source * git diff before create multidev * git status instead of git diff bail if dirty * temporarily gitignore sage test to create multidev * delete all tags from the CI site * delete the build artifact tag * remove the gitignore steps we don't need them or we shouldn't, anyway * fetch the tags before deleting the multidev artifact * remove extra git pushes so we have less sync code failures * underscore in the build artifact tag name * the other underscore, too * allow other versions of PHP * change output from listing to checking we don't output the themes dir, so we shouldn't sey we're listing it * add 8.3 * allow the build artifact tag deletion to fail if it doesn't exist, that's okay * actually bump the PHP version to the version declared * add a note when checking for unfinished/long-running workflows * allow both tag deletes to fail * remove pwd * set phpversion to 8.0 if 8 is passed * do a git status to see the change * bump version of ssh-agent * set output will be deprecated so use env variables instead https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ * get and set in the same step * remove the run of this workflow on every push just need it on merges and when we make changes to the scripts or this workflow * run the workflow whenever updates are pushed the test itself * add documentation for running the script headless * update path to script * update docs about CI env variable * remove extra line * update changelog * remove preceding slash for path to scripts * fix spacing * use latest terminus rather than figuring out a version * Don't worry about checking the exit code Co-authored-by: Phil Tyler <[email protected]> * add a newline before php_version Co-authored-by: Phil Tyler <[email protected]> * default to 0 * fix missing info prompt * git diff, not status * fix typo Co-authored-by: Phil Tyler <[email protected]> * use $siteenv * use env varibales * move the path filter for the scripts folder to push instead of PR, which doesn't seem to be triggering * wrap multidev_name in quotes * export SITEENV inside the script $multidev_name is not carrying over * use multidev_name from env * all caps env variables * don't switch to sftp mode since we're not opening the window, we don't need to switch to sftp and then switch back * actually we can still commit leftover files just don't open the browser --------- Co-authored-by: Phil Tyler <[email protected]>
- Loading branch information