From 2bf5f0bf676091787904f39baf7186431c4f6535 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 12 Sep 2022 15:17:17 +0300 Subject: [PATCH] ci: combine windows build jobs Instead of having a matrix of jobs, use a single job running all the tests like the linux jobs do. This helps with improved cache hits as most of the deps are shared between the builds. --- .gitlab-ci.yml | 8 -------- ci/run_windows_tests.ps1 | 42 +++++++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05944a46..57720f21 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -272,15 +272,7 @@ gst-build: - 'docker' - 'windows' - '2022' - parallel: - matrix: - - CI_CARGO_FEATURES: - - "--no-default-features" - - "--all-features" - - "" script: - - echo $env:CI_CARGO_FEATURES - # Set the code page to UTF-8 - chcp 65001 diff --git a/ci/run_windows_tests.ps1 b/ci/run_windows_tests.ps1 index f2333d99..7c2b5405 100644 --- a/ci/run_windows_tests.ps1 +++ b/ci/run_windows_tests.ps1 @@ -1,26 +1,42 @@ $env:ErrorActionPreference='Stop' -$exclude_crates = @( +[string[]] $exclude_crates = @( "--exclude", "gst-plugin-csound", "--exclude", "gst-plugin-webp" ) -Write-Host "Features: $env:CI_CARGO_FEATURES" -Write-Host "Exlcude string: $exclude_crates" +[string[]] $features_matrix = @( + "--no-default-features", + "", + "--all-features" +) -cargo build --color=always --workspace $exclude_crates --all-targets $env:CI_CARGO_FEATURES +function Run-Tests { + param ( + $Features + ) -if (!$?) { - Write-Host "Build failed" - Exit 1 + Write-Host "Features: $Features" + Write-Host "Exclude string: $exclude_crates" + + cargo build --color=always --workspace $exclude_crates --all-targets $Features + + if (!$?) { + Write-Host "Build failed" + Exit 1 + } + + $env:G_DEBUG="fatal_warnings" + cargo test --no-fail-fast --color=always --workspace $exclude_crates --all-targets $Features + + if (!$?) { + Write-Host "Tests failed" + Exit 1 + } } -$env:G_DEBUG="fatal_warnings" -cargo test --no-fail-fast --color=always --workspace $exclude_crates --all-targets $env:CI_CARGO_FEATURES - -if (!$?) { - Write-Host "Tests failed" - Exit 1 +foreach($feature in $features_matrix) { + Run-Tests -Features $feature }