summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2023-02-24 05:57:48 +0000
committerDaiki Ueno <ueno@gnu.org>2023-02-24 05:57:48 +0000
commitad8aba5b48f45c2966ec2e719d810ba96e626339 (patch)
treee3bf7aa66fb2b3c681752efa754f1581a0d908ea
parentca61668d7764fc29fb4cc2aa396cb035e176636d (diff)
parent87c1e162212004c7679c851d23e30faecfb078fb (diff)
downloadgnutls-ad8aba5b48f45c2966ec2e719d810ba96e626339.tar.gz
Merge branch 'wip/ci-fixes-3_7_x' into 'gnutls_3_7_x'
.gitlab-ci.yml: use artifacts:untracked [3.7.x] See merge request gnutls/gnutls!1710
-rw-r--r--.gitlab-ci.yml35
-rwxr-xr-xdevel/preserve-timestamp61
2 files changed, 76 insertions, 20 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9b49210c00..5b8659ca8d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,6 +5,7 @@ stages:
- archive
variables:
+ GIT_SUBMODULE_STRATEGY: recursive
# we utilize the images generated by the build-images project, to
# speed up CI runs. We also use ccache and store config.cache
# to speed up compilation. We include a version number in cache
@@ -29,7 +30,7 @@ variables:
CHECKJOBS: 16
cache:
- key: "$CI_JOB_NAME-ver26"
+ key: "$CI_JOB_NAME-ver29"
paths:
- cache/
@@ -44,6 +45,10 @@ cache:
default:
before_script:
- *prepare-ccache
+ - |
+ if test -e stamp.pre-bootstrap; then
+ devel/preserve-timestamp --restore stamp.pre-bootstrap
+ fi
after_script:
# after_script is executed in separate shell
@@ -58,18 +63,11 @@ default:
- shared
- linux
script:
- - SUBMODULE_NOFETCH=1 ./bootstrap
+ - devel/preserve-timestamp stamp.pre-bootstrap
+ - SUBMODULE_NOFETCH=1 ./bootstrap --copy --skip-po
artifacts:
expire_in: 1 day
- #when: on_failure
- paths:
- - ./
- exclude:
- - .git/ # passing forward .git causes warnings and possibly problems
- - ./**/.git/ # passing forward .git causes warnings and possibly problems
- - ./**/*.c
- - ./**/*.h
- - ./**/*.o
+ untracked: true
.build:
stage: build
@@ -80,15 +78,7 @@ default:
- tags # TODO
artifacts:
expire_in: 1 day
- #when: on_failure
- paths:
- - ./
- exclude:
- - .git/ # passing forward .git causes warnings and possibly problems
- - ./**/.git/ # passing forward .git causes warnings and possibly problems
- - ./**/*.c
- - ./**/*.h
- - ./**/*.o
+ untracked: true
.test:
stage: test
@@ -135,6 +125,10 @@ default:
WINEPATH: "/usr/${arch_name}-w64-mingw32/sys-root/mingw/bin"
before_script:
- *prepare-ccache
+ - |
+ if test -e stamp.pre-bootstrap; then
+ devel/preserve-timestamp --restore stamp.pre-bootstrap
+ fi
- mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
- echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
@@ -482,6 +476,7 @@ fedora-ktls/test:
script:
- git clone --depth 1 --branch master https://gitlab.com/gnutls/nettle.git nettle-git
- pushd nettle-git
+ - rm -rf .git # for artifacts:untracked to work
- ./.bootstrap
- ./configure --disable-documentation --prefix=${PWD}/$NETTLE_DIR $NETTLE_CONFIGURE_ARGS
- make -j$BUILDJOBS
diff --git a/devel/preserve-timestamp b/devel/preserve-timestamp
new file mode 100755
index 0000000000..9b22c34c2d
--- /dev/null
+++ b/devel/preserve-timestamp
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# Copyright (c) 2023 Daiki Ueno
+# License: GPLv3+ <http://gnu.org/licenses/gpl.html>
+
+progname=$0
+
+mode=save
+verbose=false
+
+while test $# -gt 0; do
+ case "$1" in
+ --save )
+ mode=save
+ shift ;;
+ --restore )
+ mode=restore
+ shift ;;
+ --help )
+ echo "Usage: preserve-timestamp [--verbose] [--save|--restore] FILE"
+ exit ;;
+ --verbose )
+ verbose=true
+ shift ;;
+ -* )
+ echo "preserve-timestamp: unknown option $1" 1>&2
+ echo "Try 'preserve-timestamp --help' for more information." 1>&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# = 0; then
+ echo "$progname: *** missing FILE argument" 1>&2
+ echo "$progname: *** Stop." 1>&2
+ exit 1
+fi
+
+file=$1
+
+case $mode in
+ save )
+ : > "$file"
+ git ls-files --recurse-submodules | \
+ while read f; do
+ if $verbose; then
+ echo "$f"
+ fi
+ { stat --printf="@%.Y " "$f"; echo "$f"; } >> "$file"
+ done
+ ;;
+ restore )
+ while read t f; do
+ if $verbose; then
+ echo "$f"
+ fi
+ touch -d "$t" "$f"
+ done < "$file"
+ ;;
+esac