Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PORT] Bring our workflows into (mostly) parity with tgstation's work…
…flows (#2348) * Update emoji remover workflow for node16 (#75434) ## About The Pull Request Bumps the emoji remover action's commit hash +1 to [the current one](Wayland-Smithy/emoji-stripper-action@de0c1d1) which has passed my node16 testing. Necessary for when github intends to disable node12 later this year. ## Why It's Good For The Repo Paying off some tech debt so the action continues to help maintain maintainer sanity into 2024 and byond, ## Changelog Non player/admin facing change. * Include temporary library for getting sleeping procs (#77773) @LemonInTheDark wanted this to be able to hunt down the progress bar hard dels. Code is here: https://gist.github.com/Mothblocks/06b415afd75672fb03637804435350d2 Intended to be reverted once we figure out the issue, or if we realize it's not related. This library is not stable. * Replace DreamAnnotate action with a python script (#78225) ## About The Pull Request This PR removes the "Annotate Lints" job step and merges it with the "Run Linters" step above. To achieve this, I wrote a python script that should be identical to the action. I even added the ability to read the output from a file to the script if we ever needed that, but I decided to have the job step pipe the output into the script instead. ## Why It's Good For The Game It always bugged me a bit that we had to check the results for a separate step if we wanted to see the linter results for dm code. I also noticed a few people getting confused as to why their CI failed on linters. Turns out that the action is just a few lines that match the dreamchecker output and reformat it to a format that GitHub can annotate code with. It's so brain dead simple that it shouldn't need to be a whole new step, and for the previous two reasons. ## Changelog not playerfacing * Split Run Linters step into multiple steps (#78265) ## About The Pull Request Splits the big "Run Linters" step into multiple steps. Also since all of these steps are independent of eachother, I've made them all run regardless of if the job is currently failing. <details> <summary>Proof of testing:</summary> Fail in install tools, all linting steps are skipped: https://github.com/distributivgesetz/tgstation/actions/runs/6151628214/job/16692089726 Fail in Run DreamChecker, other steps continue to run: https://github.com/distributivgesetz/tgstation/actions/runs/6151664705/job/16692203569?pr=2 </details> <details> <summary>Pictured: me breaking CI for a day</summary> https://github.com/tgstation/tgstation/assets/47710522/ea12ad30-2b69-4aa3-9642-7d0818eab2d1 </details> ## Why It's Good For The Game Going through the Run Linters step has always been a slog. Finding an error is like finding a needle in a haystack. Seeing what command exactly went wrong is going to go a long way in helping people find out which linters have failed. ## Changelog nothing playerfacing * Fix some odd vscode highlighting errors in workflow files (#78274) ## About The Pull Request few errors which were odd and annoying ## Why It's Good For The Game stealing PRs from san7890, they wanted to do this ## Changelog nothing playerfacing * [NO GBP] Fixes me actually breaking Run DreamChecker (#78291) > `bash`/`sh`: By default, fail-fast behavior is enforced using `set -e` for both `sh` and `bash`. When `shell: bash` is specified, `-o pipefail` is also applied to enforce early exit from pipelines that generate a non-zero exit status. it helps when I actually read the docs * Caches Node and Python Bootstrap for GH Actions (#78307) ## About The Pull Request I was planning on doing this a lot earlier but ran into some weird roadblocks, but this time I finally did the research and it's done properly. We do a lot of useless work on every single CI run, and in the interest of saving the world's energy (by a matter of at least 10 seconds per my testing), lets stop doing so much extra work by caching both the work we do on the python bootstrap installation (we literally call it `cache` for a reason) and the Node installation by sharing it between github actions runners. Here's a random CI run on master where you can see that the `Install Tools` portion takes about 19 seconds - https://github.com/tgstation/tgstation/actions/runs/6167104927/job/16737570519 Here's the CI run I was testing with where you can see we slim it down to about 6 seconds for the `Install Tools` step, but with a second-or-so taken to restore the cache since the runner needs to download+unzip the cache. it tends to be shorter or longer by a second at times but i'm certain this is just noise - https://github.com/san7890/bruhstation/actions/runs/6167245722/job/16737919874 On average, we save about **10 seconds** a run on Run Linters, which is meant to be the fastest CI step. Future improvements would lie in making either maplint or the tgui test suite faster, but that would be a much more complicated and code-intensive task. cache go weeeee ## Changelog Nothing that concerns players. * Removes Sleep Printing Library (#78324) per moth's instructions * Fixes TFE being useless after #78265 (#78433) I thought `set +e` would still make the shell exit with an error if any command failed, I didn't think that it would just use the exit code of the last command. I am dumb, I'm an idiot and I want to cry. * Fixes Rust Caching for Run Linters (#80168) Ripgrep got updated some time ago, and that means that our cache went out of date as we had to keep doing more work to install the new dependencies that it has. This means we were eating up another **50 seconds** every time we ran Run Linters. Unfortunately, github caches will only hash to a file that exists on the repository, not anything that might exist after a tool is installed. So, in order to do this, we create a new bash file `install_ripgrep.sh` and also pin the ripgrep version. If we need to reap some new benefits or it's substantially faster (which might not be the case as ripgrep is already blazing fast), we just need to update `ci_dependencies.sh` and the cache should work for future versions without us needing to purge rust caches manually through github. You can view a successful run here https://github.com/san7890/bruhstation/actions/runs/7123029395/job/19394997831 I also did something similar for SpacemanDMM while i noticed it. * Fix alternate tests erroring when there are no alternate versions (#80287) It wasn't exiting gracefully because of a typo? here * Fix flaky wizard screenshot test failure, and try to make screenshot tests run more consistently (#80631) From tgstation/tgstation#80542 Not exactly sure why this only fails once. My hint is that it happens when the alternate tests are skipped from this: ![image](https://github.com/tgstation/tgstation/assets/35135081/67c261c0-e771-4696-add2-f41bb800ad65) ...though this should still be *consistent* at least. * Bumps up several GitHub `actions` to the Node 20 Version (#81770) Node 16 actions are deprecated, we need to use Node 20 actions now (as noted by this handy screenshot which spams it on every CI run) ![image](https://github.com/tgstation/tgstation/assets/34697715/24ea3013-c762-4027-951c-d598b1eec8a3) You may see https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ for more information. * Improves OpenDream Linting (Annotations and More) (#82029) ## About The Pull Request This PR does a few things. The main goal was to have it annotate the code like we do for `Run Dreamchecker`, which it now does. The code for this was mostly shamelessly ripped from the very same process I just mentioned, but stripped down a lot more for the task. Since I had to write a lot more code to handle the way we get warnings and the like from OpenDream, I didn't fold both into one program. ![image](https://github.com/tgstation/tgstation/assets/34697715/f4a05b59-5407-412e-a73f-5c069fdb4b02) ![image](https://github.com/tgstation/tgstation/assets/34697715/0d3335aa-0da1-45ed-af19-1d17a7fc4174) It works! Ta-da. Anyways, in order to facilitate the code annotation, we need to use a Python script. This Python script means that we need to use the bootstrap, and the bootstrap is best used with the bootstrap cache. I then realized that we should just really fold this special CI runner into the Run Linters workflow anyways, instead of having it on its own runner (since it'll cut into the number of runners we have available at a time anyways). I think it's a good way to save precious CPU cycles on our dying Earth, and the issues are now visible enough to the average coder (in the `Files Changed` tab) to where I feel pretty good about doing this. There's a bit of weirdness and jank in the Python program, but it's all done for a reason I assure you (it's always silly when stuff breaks silently and no one knows to fix it until years later). You can look an example of a failing run here: https://github.com/san7890/bruhstation/actions/runs/8303759645/job/22728427623#step:17:14 * Actually Caches The BYOND Installation in CI (#82364) ## About The Pull Request Fun fact, nothing ever hashbanged this, so we've been using the same weeks-old cache which has been necessitating that we use the same old versions of BYOND until someone cleaned the cache. Let's tie to `dependencies.sh` like everything else (which we already did in #78307 (5e1c8bd)) so we don't have to keep wasting time in CI compilations having to reinstall the needed BYOND version from scratch (and have caches date and auto-clear themselves when outdated) the advantage is that we spend less time downloading/installing BYOND in CI runs and can actually run CI * Cancel CI on new commit (#83255) This sets concurrency at the workflow level, which should provide a more concise way to eject if a new commit is entered https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency I've also added timeouts that are between 5-15 minutes per test. Default is 360 minutes without this * Icon Cutter has not been ported yet, so let's not waste a step on that yet * Revert "Fix flaky wizard screenshot test failure, and try to make screenshot tests run more consistently (#80631)" This reverts commit 93edfa1. --------- Co-authored-by: Wayland-Smithy <[email protected]> Co-authored-by: Mothblocks <[email protected]> Co-authored-by: distributivgesetz <[email protected]> Co-authored-by: san7890 <[email protected]> Co-authored-by: LemonInTheDark <[email protected]> Co-authored-by: vvvv-vvvv <[email protected]> Co-authored-by: Jeremiah <[email protected]>
- Loading branch information