altinn-studio icon indicating copy to clipboard operation
altinn-studio copied to clipboard

Optimize PR checks

Open mlqn opened this issue 8 months ago • 0 comments

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 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).

PR checks

BEFORE AFTER

before

after

Docker layer caching

BEFORE AFTER
before after

Related Issue(s)

  • #12474
  • #12387

Verification

  • [x] Your code builds clean without any errors or warnings
  • [x] Manual testing done (required)

mlqn avatar Jun 26 '24 11:06 mlqn