fix build cache
[vector-math.git] / .gitlab-ci.yml
index 5605a1c093c6fedbe747e1c5fcb0e118ec5f9c90..aa2191980643114da1254920f7ff380fece88bfa 100644 (file)
@@ -1,3 +1,7 @@
+variables:
+    XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
+    CARGO_HOME: $CI_PROJECT_DIR/.cache/.cargo
+
 stages:
     - build
 
@@ -5,12 +9,47 @@ rust-latest:
     stage: build
     image: rust:latest
     script:
-        - cargo build --verbose --features=fma,f16,ir
-        - cargo test --verbose --features=fma,f16,ir
+        - cargo build --verbose --no-default-features --features="$FEATURES"
+        - cargo test --verbose --no-default-features --features="$FEATURES"
+    parallel:
+        matrix:
+            - FEATURES: ["", "fma,ir", "f16,ir", "fma,f16,ir"]
+    cache:
+        paths:
+            - .cache
+
+rust-latest-release:
+    stage: build
+    image: rust:latest
+    script:
+        - cargo build --verbose --release --no-default-features --features="$FEATURES"
+        - cargo test --verbose --release --no-default-features --features="$FEATURES"
+    parallel:
+        matrix:
+            - FEATURES:
+                  [
+                      "",
+                      "fma,ir",
+                      "f16,ir",
+                      "fma,f16,ir",
+                      "full_tests",
+                      "full_tests,fma",
+                      "full_tests,fma,f16",
+                      "full_tests,f16",
+                  ]
+    cache:
+        paths:
+            - .cache
 
 rust-nightly:
     stage: build
     image: rustlang/rust:nightly
     script:
-        - cargo build --verbose --features=stdsimd
-        - cargo test --verbose --features=stdsimd
+        - cargo build --verbose --no-default-features --features="$FEATURES"
+        - cargo test --verbose --no-default-features --features="$FEATURES"
+    parallel:
+        matrix:
+            - FEATURES: ["stdsimd,fma,ir", "stdsimd,ir"]
+    cache:
+        paths:
+            - .cache