Commit Graph

313 Commits

Author SHA1 Message Date
Daniel Lockyer
3959c00e5e Updated path to label-actions package
refs https://github.com/TryGhost/DevOps/issues/67

- this now lives in the Actions repo to cut down on maintenance cost
2023-08-29 13:46:17 +01:00
renovate[bot]
0d0dc81299
Update peter-evans/create-or-update-comment digest to 8c21c80 (#17849)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-29 10:04:01 +02:00
renovate[bot]
457b355dce
Update peter-evans/create-or-update-comment digest to bb291f6 (#17734)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-29 09:26:22 +02:00
Daniel Lockyer
fd95eac710 Hardcoded success criteria for running canary job
refs https://github.com/TryGhost/DevOps/issues/57

- I'm not sure why but I think the `contains` are doing funky things
  and not allowing the build to run when we expect it to
- switching to a slightly different if-statement should help with that
2023-08-11 17:20:32 +02:00
Daniel Lockyer
b60d5bbe06 Added debugging to diagnose cause of skipped canary builds
refs https://github.com/TryGhost/DevOps/issues/57

- this should help us find out why canary builds are skipped in some
  circumstances
2023-08-11 10:23:10 +02:00
renovate[bot]
4139a0cadd Update peter-evans/create-or-update-comment digest to 5f22cb8 2023-08-11 09:11:18 +02:00
renovate[bot]
a28d6f780a Update peter-evans/create-or-update-comment digest to 38217c6 2023-08-09 13:19:17 +02:00
Daniel Lockyer
64af4e2742 Added more debugging to find cause of skipped canary tests
refs https://github.com/TryGhost/DevOps/issues/57

- adds a step to output the `needs` context
- adds `cancelled` as a "failed" step because it means we haven't run
  all the tests
- unfortunately there's no way to assert all elements are one type
  (success), so we have to check for existence of the negative ones
2023-08-09 12:58:56 +02:00
Sam Lord
116d11b6ab Allows unknown local cache when testing with Nx
refs: https://github.com/TryGhost/DevOps/issues/55

The documentation for this feature is here: https://nx.dev/recipes/troubleshooting/unknown-local-cache

Ideally, we'd use a remote cache, but we can just share to local cache since it's being shared by identical machines.
2023-08-08 17:57:33 +01:00
Fabien 'egg' O'Carroll
2b9e322b3e
Reverted "Disabled the Ghost-CLI Github Action" (#17562)
This reverts commit 5103b58c0c.

- We only disabled this so that we could release v5.57.1
2023-08-01 20:21:10 +00:00
Fabien "egg" O'Carroll
5103b58c0c Disabled the Ghost-CLI Github Action
This action was failing and stopping us from releasing a patch release.
The failure was a false negative, and due to what we believe is a cache issue.
2023-08-01 20:44:04 +01:00
Daniel Lockyer
58cfa6ff15 Updated dependency cache keys
- this should now restore from a shared cache but update a unique cache
  for use within the rest of the jobs
2023-07-28 10:11:52 +02:00
Daniel Lockyer
13c8a26ea4 Fixed dependency cache key with new package
- in the event there is a new package, we need to completely reset the
  cache key otherwise `yarn` won't link the packages correctly
2023-07-27 22:33:46 +02:00
renovate[bot]
8fed1abb71 Update peter-evans/create-or-update-comment digest to 716151b 2023-07-26 08:48:51 +02:00
Daniel Lockyer
af320ab864 Fixed new package detection
- turns out new packages folders aren't generating an `A` status in `git
  diff`, so this line never worked
- if we create a `package.json` file, we can reasonably assume we're
  creating a new package, so this should fix the issues we were seeing
  with caching + new packages
2023-07-25 16:15:36 +02:00
Daniel Lockyer
adc3f8e8ee Skipped dependency caching for new packages
- in this event, we don't want to cache the dependencies because the new
  package will need to be linked to the others
- this commit should add detection for new packages and skip the cache
  if so
2023-07-25 15:14:50 +02:00
renovate[bot]
3f0c26534d Update peter-evans/create-or-update-comment digest to 30a3d62 2023-07-19 10:36:32 +02:00
renovate[bot]
e315d04c5f Update peter-evans/create-or-update-comment digest to 5a5a8f5 2023-07-19 08:00:05 +02:00
Daniel Lockyer
0a7fb4c881 Reimplemented canary builds on main
refs https://github.com/TryGhost/DevOps/issues/47

- this adds a canary job that waits for successful tests and then kicks
  off the Docker build step
2023-07-18 14:52:54 +02:00
Daniel Lockyer
90adbc4865 Removed canary workflows
refs https://github.com/TryGhost/DevOps/issues/47

- we need to start building from git refs so this workflow which builds
  a tarball is no longer needed and just adds to the execution time
2023-07-14 11:24:18 +02:00
Daniel Lockyer
9f40c90e07 Switched to Nx runner for more tasks
- this switches us to using Nx for `ghost:dev`, which means we can
  configure its dependencies and ensure that the TS projects are built
  beforehand
- also switches to Nx for `ghost:archive` so we don't need to run
  `build:ts` for all `yarn` commands
2023-07-14 08:52:01 +02:00
Daniel Lockyer
e990cbba01 Configured storing Nx cache in GHA to speed up builds
refs https://github.com/TryGhost/DevOps/issues/47

- this allows us to store and restore the cache for TS builds, which
  should speed up the whole process
2023-07-14 08:52:01 +02:00
Daniel Lockyer
190a5550c3 Fixed missing command in browser tests
- `setup` no longer exists after the monorepo changes and this test
  should reflect that
2023-07-12 16:41:04 +02:00
Daniel Lockyer
757a551d1b Fixed running migrations in browser tests
- this maintains the functionality of executing migrations when running
  browser tests
2023-07-12 16:34:52 +02:00
Daniel Lockyer
2aa7da3a0b Improved monorepo tooling setup
refs https://github.com/TryGhost/DevOps/issues/45

- this switches the monorepo over to using Nx instead of Lerna, because
  we don't currently need the versioning+publishing capabilities
- this also adds an `nx.json`, which allows us to enable task caching
- also adds `build:ts` to the TS projects, which is cached for fast execution
- how these interact with the dev.js script will hopefully soon be
  reworked to be a better experience
2023-07-12 16:27:39 +02:00
renovate[bot]
ca8a03cdf6 Update peter-evans/create-or-update-comment digest to d1355c8 2023-07-12 09:34:19 +02:00
Daniel Lockyer
d38e7fd46f Disabled CI workflows for Renovate branches
refs https://github.com/TryGhost/DevOps/issues/43

- because we now enforce all commits through a PR, Renovate can no
  longer automerge commits
- this is actually a huge bonus because it simplifies a lot of the
  issues we were having with the GHA setup
- this commit removes the triggers and special handling to remove the
  duplicate executions
2023-07-11 09:30:59 +02:00
renovate[bot]
2477de3f46 Update peter-evans/create-or-update-comment digest to 540f247 2023-07-11 08:56:25 +02:00
Daniel Lockyer
f7aeb4138e Switched to printf to echo GitHub context
- printf is a little safer and should prevent issues with command
  execution within the metadata job
2023-07-10 17:54:47 +02:00
Daniel Lockyer
aa303414cb ℹ️ Bumped minimum Node 16 version to 16.14.0
fixes https://github.com/TryGhost/DevOps/issues/42

- several of our dependencies require this so making the minor bump to
  increase the version helps keep them updated
2023-07-10 16:41:34 +02:00
Daniel Lockyer
f50e878cb2 Fixed error about long filename
- echoing the data should avoid issues with piping in data through a
  file redirection
2023-07-10 15:15:12 +02:00
Daniel Lockyer
389f480c96 Removed forced pushed CI check
- we probably just want to run my logic to get the base commit for all
  pushes because otherwise the `base.sha` will be null for new branches
2023-07-10 15:03:09 +02:00
Daniel Lockyer
a5fe87cc4d Fixed caching build assets
- we shouldn't cache the build assets against the yarn.lock hash because
  the files could change independent of that file
- this bring the build caching more inline with https://github.com/getsentry/sentry-javascript/blob/develop/.github/workflows/build.yml,
  which is a big inspiration for this file
2023-07-10 14:47:08 +02:00
Daniel Lockyer
c158aa7397 Updated fetching latest base commit
- unfortunately GitHub makes this incredibly hard and this commit
  doesn't even provide a full solution, but it should allow us to fetch
  the latest commit for PRs and pushes to a branch, but not force pushes
2023-07-10 13:22:00 +02:00
Daniel Lockyer
b4d9191522 Fixed --since parameter for partial executions
- if a branch is force-pushed, the existing value is incorrect and we
  get errors from Lerna
- this switches to finding the common commit between this branch and
  the head as reported by GitHub
2023-07-10 09:55:19 +02:00
Daniel Lockyer
5b7a89d8fc Deduplicated execution check in CI workflow
- we only need this on the metadata step because it trickles down to the
  other workflows that depend on it
2023-07-10 09:55:19 +02:00
Daniel Lockyer
b6131f0631 Fixed canary build triggering
- this previously wouldn't trigger if any of the `needs` are skipped
- this switches to waiting for the actual job which checks if all
  required jobs were completed successfully
2023-07-07 15:30:22 +02:00
Daniel Lockyer
f6aeff6524 Added handling for building arch branch
refs https://github.com/TryGhost/DevOps/issues/40

- this is an experimental branch that needs a separate canary build
- these changes should help support that by allowing canary builds on
  that branch
2023-07-06 09:24:45 +02:00
Daniel Lockyer
92120324eb Updated workflow for code coverage
- added separate Admin codecov step
- removed unit test until we figure out handling for partial runs
2023-07-06 09:24:45 +02:00
Daniel Lockyer
289e459283 Added tests for migrations
refs https://github.com/TryGhost/DevOps/issues/39

- up until now, we've had a CI job which does a really basic test for
  migrations, but it barely functions and misses bugs all the time
- this commit removes that and switches to an actual test suite for our
  migrations, so we can ensure they function as expected
- also removes the env var hack I came up with for those migrations
  tests
- this should lead to safer migrations and faster tests
2023-07-05 11:00:06 +02:00
Daniel Lockyer
40e8bc09ce Optimized unit test workflow to only run for changed packages
- this implements a similar idea to linting by only running for changed
  packages, which saves ~3 minutes for this job
2023-07-05 11:00:06 +02:00
Daniel Lockyer
7ef42a49fa Implemented Playwright caching into browser-tests workflow
- this allows us to use the Playwright cache that is in place to speed
  up tests
2023-07-04 16:08:06 +02:00
Daniel Lockyer
ec94930876 Fixed only running linting on changed projects
- this configures the lint step to only run on packages that have
  changed since the previous commit
2023-07-04 14:21:05 +02:00
Daniel Lockyer
f2c2e7f687 Fixed duplicate workflow executions on PRs
- if we push to a branch, and open a PR, we'll get duplicate executions
- this fixes that by adding the same check we have elsewhere in the
  workflow
2023-07-04 12:31:00 +02:00
renovate[bot]
017a87eeeb Update actions/checkout action to v3 2023-07-04 12:16:16 +02:00
Daniel Lockyer
88954f7318 Reworked CI workflow to optimize setup
refs https://github.com/TryGhost/Toolbox/issues/609

- this rewrites the CI workflow to include a pre-test step which will
  download and cache dependencies, and will only run tests when the
  associated code changes
- this provides a huge improvement over the existing setup, and will
  save us a lot of time in CI
2023-07-04 12:03:34 +02:00
Daniel Lockyer
cb8ef8daa2 Added CI step to allow PR automerge
fixes https://github.com/TryGhost/Toolbox/issues/608

- this step will be waited on in CI config so we can ensure all tests
  have passed before automerging PRs
2023-07-03 13:45:57 +02:00
renovate[bot]
98a8727538 Update peter-evans/create-or-update-comment digest to be902ae 2023-06-28 16:23:45 +02:00
Daniel Lockyer
1bce363bd3
Updated linting and migration comment to improve practices
refs https://github.com/TryGhost/Toolbox/issues/602

- the new regex allows for the filename to contain seconds, which would have
  helped prevent a bug we had with migrations being in the wrong order
- mentioned filename ordering in the migration review comment to bring
  that to the forefront of the mind
2023-06-26 15:29:37 +02:00
Daniel Lockyer
8c5e2a53a9 Moved Admin-X-Settings to apps/ folder
refs https://github.com/TryGhost/Toolbox/issues/594

- we're moving all the external apps into a different folder so we can
  keep `ghost/` for internal code
2023-06-23 14:37:39 +02:00