altinn-studio
altinn-studio copied to clipboard
Optimize PR checks
Description
Here is the list of optimizations made on PR checks:
- Removed
build-image-on-pr.yaml
workflow since Docker images are already built by Playwright tests - Removed
Building
job fromfrontend-unit-tests.yml
workflow as the solution is already built by Playwright tests - Removed
Build all images
job fromrun-playwright-on-pr.yaml
since the solution is already built during setup - Removed
Stop compose file
job fromrun-playwright-on-pr.yaml
as it's already stopped when the VM is stopped - Removed
dotnet build
fromDockerfile
as the backend is already built bydotnet publish
- Fixed the
typecheck
command to prevent it from running multiple times. This is a quick fix, we should fix thetsconfig.json
files to make thetypecheck
command work per workspace (see: #13031) - Optimized
Dockerfile
layer caching by separating the copying ofpackage.json
andyarn.lock
files - Added a concurrency control on
run-playwright-on-pr.yaml
to stop previous running instances - Added the
--cache
flag to the eslint command to only check changed files - Added the
--changedSince
flag to the Jest command to only run tests impacted by changes in a PR We still run all the tests when merging a PR into main, as it seems that sometimes this command does not execute all the impacted files.
There are more optimizations that can be made, particularly regarding caching during the installation of Playwright, but this requires more work, so I have created a separate issue for that (see: https://github.com/Altinn/altinn-studio/issues/13028).
PR checks
BEFORE | AFTER |
---|---|
|
|
Docker layer caching
BEFORE | AFTER |
---|---|
|
|
Related Issue(s)
- #12474
- #12387
Verification
- [x] Your code builds clean without any errors or warnings
- [x] Manual testing done (required)