From 9b082e5355fd4dcdfecf9d13317f4be370717dc9 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 5 Apr 2024 16:21:13 -0700 Subject: [PATCH] ci: fixup perl path on windows when running tests --- .github/workflows/gen_windows.yml | 8 +++----- .github/workflows/gen_windows_continuous.yml | 8 +++----- .github/workflows/gen_windows_tag.yml | 8 +++----- ci/generate-workflows.py | 11 +++++++---- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/gen_windows.yml b/.github/workflows/gen_windows.yml index c0015d69f..37951564d 100644 --- a/.github/workflows/gen_windows.yml +++ b/.github/workflows/gen_windows.yml @@ -50,25 +50,21 @@ jobs: - name: "Build wezterm (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm --release - name: "Build wezterm-gui (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm-gui --release - name: "Build wezterm-mux-server (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm-mux-server --release - name: "Build strip-ansi-escapes (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p strip-ansi-escapes --release - name: "Install cargo-nextest from Cargo" @@ -78,7 +74,9 @@ jobs: cache-key: "windows" - name: "Test" shell: bash - run: "cargo nextest run --all --no-fail-fast" + run: | + PATH C:\Strawberry\perl\bin;%PATH% + cargo nextest run --all --no-fail-fast - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_windows_continuous.yml b/.github/workflows/gen_windows_continuous.yml index 10b1aad45..b020a25ca 100644 --- a/.github/workflows/gen_windows_continuous.yml +++ b/.github/workflows/gen_windows_continuous.yml @@ -53,25 +53,21 @@ jobs: - name: "Build wezterm (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm --release - name: "Build wezterm-gui (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm-gui --release - name: "Build wezterm-mux-server (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm-mux-server --release - name: "Build strip-ansi-escapes (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p strip-ansi-escapes --release - name: "Install cargo-nextest from Cargo" @@ -81,7 +77,9 @@ jobs: cache-key: "windows" - name: "Test" shell: bash - run: "cargo nextest run --all --no-fail-fast" + run: | + PATH C:\Strawberry\perl\bin;%PATH% + cargo nextest run --all --no-fail-fast - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_windows_tag.yml b/.github/workflows/gen_windows_tag.yml index 2d0117acb..b1a30efbf 100644 --- a/.github/workflows/gen_windows_tag.yml +++ b/.github/workflows/gen_windows_tag.yml @@ -40,25 +40,21 @@ jobs: - name: "Build wezterm (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm --release - name: "Build wezterm-gui (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm-gui --release - name: "Build wezterm-mux-server (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p wezterm-mux-server --release - name: "Build strip-ansi-escapes (Release mode)" shell: cmd run: | - PATH C:\Strawberry\perl\bin;%PATH% cargo build -p strip-ansi-escapes --release - name: "Install cargo-nextest from Cargo" @@ -68,7 +64,9 @@ jobs: cache-key: "windows" - name: "Test" shell: bash - run: "cargo nextest run --all --no-fail-fast" + run: | + PATH C:\Strawberry\perl\bin;%PATH% + cargo nextest run --all --no-fail-fast - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index 803a82729..274c37ae6 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -424,6 +424,11 @@ rustup default {toolchain} ) ] + def fixup_windows_path(self, cmd): + if "win" in self.name: + return "PATH C:\\Strawberry\\perl\\bin;%PATH%\n" + cmd + return cmd + def build_all_release(self): bin_crates = [ "wezterm", @@ -438,9 +443,7 @@ rustup default {toolchain} RunStep( name=f"Build {bin} (Release mode)", shell="cmd", - run=f""" -PATH C:\\Strawberry\\perl\\bin;%PATH% -cargo build -p {bin} --release""", + run=self.fixup_windows_path(f"cargo build -p {bin} --release"), ) ] elif "macos" in self.name: @@ -479,7 +482,7 @@ cargo build -p {bin} --release""", # Run tests RunStep( name="Test", - run=run, + run=self.fixup_windows_path(run), ), ]