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 from frontend-unit-tests.yml workflow as the solution is already built by Playwright tests
Removed Build all images job from run-playwright-on-pr.yaml since the solution is already built during setup
Removed Stop compose file job from run-playwright-on-pr.yaml as it's already stopped when the VM is stopped
Removed dotnet build from Dockerfile as the backend is already built by dotnet publish
Fixed the typecheck command to prevent it from running multiple times. This is a quick fix, we should fix the tsconfig.json files to make the typecheck command work per workspace (see: #13031)
Optimized Dockerfile layer caching by separating the copying of package.json and yarn.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).
Description
Here is the list of optimizations made on PR checks:
build-image-on-pr.yaml
workflow since Docker images are already built by Playwright testsBuilding
job fromfrontend-unit-tests.yml
workflow as the solution is already built by Playwright testsBuild all images
job fromrun-playwright-on-pr.yaml
since the solution is already built during setupStop compose file
job fromrun-playwright-on-pr.yaml
as it's already stopped when the VM is stoppeddotnet build
fromDockerfile
as the backend is already built bydotnet publish
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)Dockerfile
layer caching by separating the copying ofpackage.json
andyarn.lock
filesrun-playwright-on-pr.yaml
to stop previous running instances--cache
flag to the eslint command to only check changed files--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
Docker layer caching
Related Issue(s)
12474
12387
Verification