]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
build.yaml: Collect testdir from either build or .
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 23 Aug 2020 18:31:40 +0000 (20:31 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 25 Aug 2020 16:48:31 +0000 (18:48 +0200)
Also fix the name attribute sent to actions/upload-artifact.

.github/workflows/build.yaml
ci/collect-testdir [new file with mode: 0755]

index ff0553743d8afef6815a3ff6eb47fffe2039eea1..31c797061419d814f9ce39f2a194914f72548dee 100644 (file)
@@ -42,13 +42,13 @@ jobs:
 
       - name: Collect testdir from failed tests
         if: failure()
-        run: tar -caf testdir.tar.xz ${{ matrix.config.BUILDDIR }}/testdir
+        run: ci/collect-testdir
 
       - name: Upload testdir from failed tests
         if: failure()
         uses: actions/upload-artifact@v2
         with:
-          name: ${{ matrix.config.name }} - testdir.tar.xz
+          name: ${{ matrix.os }} - ${{ matrix.compiler.CC }} - testdir.tar.xz
           path: testdir.tar.xz
 
   specific_tests:
@@ -207,7 +207,7 @@ jobs:
 
       - name: Collect testdir from failed tests
         if: failure()
-        run: tar -caf testdirs.tar.xz ${{ matrix.config.BUILDDIR }}/testdir
+        run: ci/collect-testdir
         # TODO: in case of build-and-verify-package* the BUILDDIR is set within those scripts.
 
       - name: Upload testdir from failed tests
diff --git a/ci/collect-testdir b/ci/collect-testdir
new file mode 100755 (executable)
index 0000000..21a3971
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ -d testdir ]; then
+    testdir=testdir
+elif [ -d build/testdir ]; then
+    testdir=build/testdir
+else
+    echo "No testdir found" >&2
+    exit 1
+fi
+
+tar -caf testdir.tar.xz $testdir