Skip to content

Commit

Permalink
save _build_ci for some jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySkimmer committed Dec 17, 2024
1 parent 58cefec commit 5f66ee9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ before_script:
- dune printenv --root .
- dev/tools/check-cachekey.sh
- dev/tools/list-potential-artifacts.sh > downloaded_artifacts.txt
- if [ -d saved_build_ci ]; then mv saved_build_ci _build_ci; fi
- dev/ci/gitlab-section.sh end before_script

# Regular "release" build of Coq, with final installed layout
Expand Down Expand Up @@ -193,12 +194,17 @@ before_script:
- echo CI_TARGETS = ${CI_TARGETS:=${CI_JOB_NAME#*:ci-}}
- for target in $CI_TARGETS; do dev/ci/ci-wrapper.sh "$target"; done
after_script:
- if [ "$SAVE_BUILD_CI" ] && [ -d _build_ci ]; then mv _build_ci saved_build_ci; fi
- dev/tools/list-potential-artifacts.sh > available_artifacts.txt
- dev/tools/cleanup-artifacts.sh downloaded_artifacts.txt available_artifacts.txt
artifacts:
name: "$CI_JOB_NAME"
paths:
- _install_ci
- saved_build_ci
exclude: # reduce artifact size
- saved__build_ci/**/.git # exclude .git directory itself as well
- saved_build_ci/**/.git/**/*
when: always
expire_in: 1 week
needs:
Expand Down Expand Up @@ -618,6 +624,7 @@ library:ci-bedrock2:
extends: .ci-template-flambda
variables:
NJOBS: "1"
SAVE_BUILD_CI: "1"
needs:
- build:edge+flambda
- library:ci-stdlib+flambda
Expand Down Expand Up @@ -734,6 +741,7 @@ library:ci-fiat_crypto:
extends: .ci-template-flambda
variables:
COQEXTRAFLAGS: "-async-proofs-tac-j 0"
SAVE_BUILD_CI: "1"
needs:
- build:edge+flambda
- library:ci-stdlib+flambda
Expand Down Expand Up @@ -846,6 +854,8 @@ library:ci-mathcomp:
- library:ci-stdlib+flambda
- plugin:ci-elpi_hb # for Hierarchy Builder
stage: build-2
variables:
SAVE_BUILD_CI: "1"

library:ci-mathcomp_test:
extends: .ci-template-flambda
Expand Down Expand Up @@ -1102,6 +1112,7 @@ plugin:ci-elpi_hb:
- library:ci-stdlib+flambda
variables:
CI_TARGETS: "elpi hb"
SAVE_BUILD_CI: "1"

plugin:ci-elpi_test:
extends: .ci-template-flambda
Expand Down Expand Up @@ -1192,6 +1203,8 @@ plugin:ci-quickchick:
- plugin:ci-elpi_hb
- library:ci-mathcomp
stage: build-3+
variables:
SAVE_BUILD_CI: "1"

plugin:ci-quickchick_test:
extends: .ci-template-flambda
Expand Down
6 changes: 4 additions & 2 deletions dev/tools/cleanup-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ awk 'BEGIN{while( (getline k < "'"$before"'")>0 ){a[k]}} $0 in a' "$after" > rem

xargs -a removed_artifacts.txt rm

if [ -d _install_ci ]; then
find _install_ci -type d -empty -delete
for d in _install_ci saved_build_ci; do
if [ -d $d ]; then
find $d -type d -empty -delete
fi
done
8 changes: 5 additions & 3 deletions dev/tools/list-potential-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

if [ -d _install_ci ]; then
find _install_ci -type f -o -type l | sort
fi
for d in _install_ci saved_build_ci; do
if [ -d $d ]; then
find $d -type f -o -type l | sort
fi
done

0 comments on commit 5f66ee9

Please sign in to comment.