From f4087df7eb663447cb1e2df0ce8114e3c25e0e02 Mon Sep 17 00:00:00 2001 From: Shravan Vasista Date: Wed, 16 Oct 2024 10:25:02 -0700 Subject: [PATCH] Fix Install WDK (NuGet) script's condition in accordance to the powershell shell --- .github/workflows/build.yaml | 11 +++++------ .github/workflows/docs.yaml | 10 +++++----- .github/workflows/lint.yaml | 10 +++++----- .github/workflows/local-development-makefile.yaml | 10 +++++----- .github/workflows/test.yaml | 10 +++++----- 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0c8da98e..7f3a3f55 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -74,14 +74,13 @@ jobs: - name: Install ${{ matrix.wdk }} (NuGet) if: startsWith(matrix.wdk, '10.0.') run: | - wdk="${{ matrix.wdk }}" - if [[ "$wdk" =~ ^10\.0\.[0-9]{5}\.[0-9]{1,4}$ ]]; then + $wdk = '${{ matrix.wdk }}' + if ($wdk -match '^10\.0\.\d{5}\.\d{1,4}$') { ./.github/scripts/nuget-install-wdk.ps1 -wdkVersion $wdk - else - echo "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" + } else { + Write-Host "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" exit 1 - fi - shell: bash + } - name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) uses: dtolnay/rust-toolchain@master diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 70bbb994..d85b30ff 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -69,13 +69,13 @@ jobs: - name: Install ${{ matrix.wdk }} (NuGet) if: startsWith(matrix.wdk, '10.0.') run: | - wdk="${{ matrix.wdk }}" - if [[ "$wdk" =~ ^10\.0\.[0-9]{5}\.[0-9]{1,4}$ ]]; then + $wdk = '${{ matrix.wdk }}' + if ($wdk -match '^10\.0\.\d{5}\.\d{1,4}$') { ./.github/scripts/nuget-install-wdk.ps1 -wdkVersion $wdk - else - echo "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" + } else { + Write-Host "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" exit 1 - fi + } - name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) uses: dtolnay/rust-toolchain@master diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 576e8e1a..2c4eff73 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -68,13 +68,13 @@ jobs: - name: Install ${{ matrix.wdk }} (NuGet) if: startsWith(matrix.wdk, '10.0.') run: | - wdk="${{ matrix.wdk }}" - if [[ "$wdk" =~ ^10\.0\.[0-9]{5}\.[0-9]{1,4}$ ]]; then + $wdk = '${{ matrix.wdk }}' + if ($wdk -match '^10\.0\.\d{5}\.\d{1,4}$') { ./.github/scripts/nuget-install-wdk.ps1 -wdkVersion $wdk - else - echo "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" + } else { + Write-Host "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" exit 1 - fi + } - name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) uses: dtolnay/rust-toolchain@master diff --git a/.github/workflows/local-development-makefile.yaml b/.github/workflows/local-development-makefile.yaml index b5801a2a..377eef39 100644 --- a/.github/workflows/local-development-makefile.yaml +++ b/.github/workflows/local-development-makefile.yaml @@ -60,13 +60,13 @@ jobs: - name: Install ${{ matrix.wdk }} (NuGet) if: startsWith(matrix.wdk, '10.0.') run: | - wdk="${{ matrix.wdk }}" - if [[ "$wdk" =~ ^10\.0\.[0-9]{5}\.[0-9]{1,4}$ ]]; then + $wdk = '${{ matrix.wdk }}' + if ($wdk -match '^10\.0\.\d{5}\.\d{1,4}$') { ./.github/scripts/nuget-install-wdk.ps1 -wdkVersion $wdk - else - echo "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" + } else { + Write-Host "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" exit 1 - fi + } - name: Install Nightly Rust Toolchain (${{ matrix.target_triple }}) uses: dtolnay/rust-toolchain@nightly with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 175171c6..d9e78685 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -66,13 +66,13 @@ jobs: - name: Install ${{ matrix.wdk }} (NuGet) if: startsWith(matrix.wdk, '10.0.') run: | - wdk="${{ matrix.wdk }}" - if [[ "$wdk" =~ ^10\.0\.[0-9]{5}\.[0-9]{1,4}$ ]]; then + $wdk = '${{ matrix.wdk }}' + if ($wdk -match '^10\.0\.\d{5}\.\d{1,4}$') { ./.github/scripts/nuget-install-wdk.ps1 -wdkVersion $wdk - else - echo "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" + } else { + Write-Host "WDK version $wdk does not match the required format 10.0.{5 digit number}.{1 to 4 digit number}" exit 1 - fi + } - name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) uses: dtolnay/rust-toolchain@master