Skip to content

Commit

Permalink
cache work. wip go sum
Browse files Browse the repository at this point in the history
  • Loading branch information
josiahzimmerman-caci committed Jan 8, 2025
1 parent 1f83782 commit ab24b47
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,13 @@ stages:
- if: '$debug == "true"'

.install_yarn: &install_yarn
- yarn install --frozen-lockfile --cache-folder /builds/milmove/mymove/.cache/yarn
- scripts/check-generated-code yarn.lock
- echo "yarn check dependencies"
- ./scripts/rebuild-dependencies-without-binaries

.yarn_check_cache_and_install: &yarn_check_cache_and_install
- echo "Checking for cached Yarn dependencies..."
- |
if [ -d "/builds/milmove/mymove/.cache/yarn" ]; then
echo "Cache found. Skipping Yarn install.";
else
echo "No cache found. Installing dependencies.";
mkdir /builds/milmove/mymove/.cache
mkdir /builds/milmove/mymove/.cache/yarn
yarn config set "strict-ssl" false
yarn install --frozen-lockfile --cache-folder /builds/milmove/mymove/.cache/yarn;
fi
- |
mkdir /builds/milmove/mymove/.cache
mkdir /builds/milmove/mymove/.cache/yarn
yarn install --frozen-lockfile --cache-folder /builds/milmove/mymove/.cache/yarn
scripts/check-generated-code yarn.lock
echo "yarn check dependencies"
./scripts/rebuild-dependencies-without-binaries
.yarn_cache: &yarn_cache
cache:
Expand Down Expand Up @@ -321,7 +311,6 @@ pre_deps_yarn:
before_script:
- *setup_milmove_env
script:
- *yarn_check_cache_and_install
- *install_yarn
<<: *yarn_cache
after_script:
Expand Down Expand Up @@ -402,7 +391,6 @@ build_storybook:
<<: *yarn_cache
before_script:
- *setup_milmove_env
- *yarn_check_cache_and_install
- *install_yarn
script:
- yarn build-storybook
Expand Down Expand Up @@ -436,11 +424,14 @@ deploy_storybook_dp3:
compile_app_client:
stage: build
image: $DOCKER_APP_IMAGE
<<: *yarn_cache
variables:
KUBERNETES_CPU_REQUEST: "6"
KUBERNETES_MEMORY_REQUEST: "8Gi"
KUBERNETES_MEMORY_LIMIT: "8Gi"
before_script: *setup_milmove_env
before_script:
- *setup_milmove_env
- *install_yarn
needs:
- pre_deps_yarn
script:
Expand All @@ -461,14 +452,17 @@ compile_app_client:
compile_app_server:
stage: build
image: $DOCKER_APP_IMAGE
<<: *yarn_cache
variables:
KUBERNETES_CPU_REQUEST: "6"
KUBERNETES_MEMORY_REQUEST: "6Gi"
KUBERNETES_MEMORY_LIMIT: "8Gi"
needs:
- pre_deps_golang
- pre_deps_yarn
before_script: *setup_milmove_env
before_script:
- *setup_milmove_env
- *install_yarn
script:
- make -j 4 server_build build_tools
- echo "Skipping server and tools compilation."
Expand Down Expand Up @@ -500,6 +494,7 @@ compile_app_server:
pre_test:
stage: test
image: $DOCKER_APP_IMAGE
<<: *yarn_cache
needs:
- pre_deps_golang
- pre_deps_yarn
Expand All @@ -516,7 +511,7 @@ pre_test:
- |
[ -d ~/transcom/mymove/spectral ] && cp -r ~/transcom/mymove/spectral /tmp/spectral_baseline || echo "Skipping saving baseline"
- rm -rf ~/transcom/mymove/spectral
- *yarn_check_cache_and_install
- *install_yarn
- ./scripts/pre-commit-go-mod || exit 0
- echo "Run pre-commit tests without golangci-lint, eslint, or prettier"
- SKIP=golangci-lint,eslint,prettier,ato-go-linter,gomod,appcontext-linter pre-commit run --all-files
Expand Down Expand Up @@ -648,7 +643,6 @@ client_test:
<<: *yarn_cache
before_script:
- *setup_milmove_env
- *yarn_check_cache_and_install
- *install_yarn
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
dependencies:
Expand Down

0 comments on commit ab24b47

Please sign in to comment.