Commit 781cc731ed

Alex Rønne Petersen <alex@alexrp.com>
2025-09-28 19:44:02
ci: move Git repository unshallowing to the workflow
1 parent acf8d52
.github/workflows/ci.yaml
@@ -18,6 +18,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: sh ci/x86_64-linux-debug.sh
   x86_64-linux-debug-llvm:
@@ -26,6 +28,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: sh ci/x86_64-linux-debug-llvm.sh
   x86_64-linux-release:
@@ -34,6 +38,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: sh ci/x86_64-linux-release.sh
   aarch64-linux-debug:
@@ -41,6 +47,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: sh ci/aarch64-linux-debug.sh
   aarch64-linux-release:
@@ -48,6 +56,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: sh ci/aarch64-linux-release.sh
   aarch64-macos-debug:
@@ -55,6 +65,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: ci/aarch64-macos-debug.sh
   aarch64-macos-release:
@@ -62,6 +74,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: ci/aarch64-macos-release.sh
   x86_64-windows-debug:
@@ -70,6 +84,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: ci/x86_64-windows-debug.ps1
   x86_64-windows-release:
@@ -78,5 +94,7 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Build and Test
         run: ci/x86_64-windows-release.ps1
ci/aarch64-linux-debug.sh
@@ -13,11 +13,6 @@ ZIG="$PREFIX/bin/zig"
 
 export PATH="$HOME/local/bin:$PATH"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/aarch64-linux-release.sh
@@ -13,11 +13,6 @@ ZIG="$PREFIX/bin/zig"
 
 export PATH="$HOME/local/bin:$PATH"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/aarch64-macos-debug.sh
@@ -21,11 +21,6 @@ fi
 
 cd $ZIGDIR
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/aarch64-macos-release.sh
@@ -21,11 +21,6 @@ fi
 
 cd $ZIGDIR
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/aarch64-windows.ps1
@@ -22,14 +22,6 @@ function CheckLastExitCode {
     return 0
 }
 
-# Make the `zig version` number consistent.
-# This will affect the `zig build` command below which uses `git describe`.
-git fetch --tags
-
-if ((git rev-parse --is-shallow-repository) -eq "true") {
-    git fetch --unshallow # `git describe` won't work on a shallow repo
-}
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/loongarch64-linux-debug.sh
@@ -11,11 +11,6 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.157+7fdd60df1"
 PREFIX="$HOME/deps/$CACHE_BASENAME"
 ZIG="$PREFIX/bin/zig"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/loongarch64-linux-release.sh
@@ -11,11 +11,6 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.157+7fdd60df1"
 PREFIX="$HOME/deps/$CACHE_BASENAME"
 ZIG="$PREFIX/bin/zig"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/riscv64-linux-debug.sh
@@ -13,11 +13,6 @@ ZIG="$PREFIX/bin/zig"
 
 export PATH="$HOME/local/bin:$PATH"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/riscv64-linux-release.sh
@@ -13,11 +13,6 @@ ZIG="$PREFIX/bin/zig"
 
 export PATH="$HOME/local/bin:$PATH"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/x86_64-freebsd-debug.sh
@@ -11,11 +11,6 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.312+164c598cd"
 PREFIX="$HOME/deps/$CACHE_BASENAME"
 ZIG="$PREFIX/bin/zig"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/x86_64-freebsd-release.sh
@@ -11,11 +11,6 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.312+164c598cd"
 PREFIX="$HOME/deps/$CACHE_BASENAME"
 ZIG="$PREFIX/bin/zig"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/x86_64-linux-debug-llvm.sh
@@ -13,11 +13,6 @@ ZIG="$PREFIX/bin/zig"
 
 export PATH="$HOME/deps/wasmtime-v29.0.0-x86_64-linux:$HOME/deps/qemu-linux-x86_64-10.1.0/bin:$HOME/local/bin:$PATH"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/x86_64-linux-debug.sh
@@ -13,11 +13,6 @@ ZIG="$PREFIX/bin/zig"
 
 export PATH="$HOME/deps/wasmtime-v29.0.0-x86_64-linux:$HOME/deps/qemu-linux-x86_64-10.1.0/bin:$HOME/local/bin:$PATH"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/x86_64-linux-release.sh
@@ -13,11 +13,6 @@ ZIG="$PREFIX/bin/zig"
 
 export PATH="$HOME/deps/wasmtime-v29.0.0-x86_64-linux:$HOME/deps/qemu-linux-x86_64-10.1.0/bin:$HOME/local/bin:$PATH"
 
-# Make the `zig version` number consistent.
-# This will affect the cmake command below.
-git fetch --unshallow || true
-git fetch --tags
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/x86_64-windows-debug.ps1
@@ -22,14 +22,6 @@ function CheckLastExitCode {
     return 0
 }
 
-# Make the `zig version` number consistent.
-# This will affect the `zig build` command below which uses `git describe`.
-git fetch --tags
-
-if ((git rev-parse --is-shallow-repository) -eq "true") {
-    git fetch --unshallow # `git describe` won't work on a shallow repo
-}
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.
ci/x86_64-windows-release.ps1
@@ -22,14 +22,6 @@ function CheckLastExitCode {
     return 0
 }
 
-# Make the `zig version` number consistent.
-# This will affect the `zig build` command below which uses `git describe`.
-git fetch --tags
-
-if ((git rev-parse --is-shallow-repository) -eq "true") {
-    git fetch --unshallow # `git describe` won't work on a shallow repo
-}
-
 # Override the cache directories because they won't actually help other CI runs
 # which will be testing alternate versions of zig, and ultimately would just
 # fill up space on the hard drive for no reason.