Skip to content

Commit

Permalink
Fix runInBand arg ignored on Windows + Node 22
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Johnson <[email protected]>
  • Loading branch information
t1m0thyj committed Dec 26, 2024
1 parent 27ef793 commit 8d1dc81
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/zowe-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ on:
workflow_dispatch:
inputs:
binary-type:
type: choice
description: Specify whether to use a `debug` or a `release` version of the binary
default: debug
required: false
options:
- debug
- release
test-type:
type: choice
description: Specify whether to run tests using the `binary` or regular `nodejs` executable
default: binary
required: false
options:
- binary
- nodejs
macos-type:
type: choice
description: Run against x86-based MacOS (12), otherwise run against ARM64-based MacOS (14)
Expand Down Expand Up @@ -66,20 +72,12 @@ jobs:
echo "::remove-matcher owner=eslint-compact::"
echo "::remove-matcher owner=eslint-stylish::"
- name: Get NPM Version
id: npm-version
run: echo "number=$(npm --version)" >> $GITHUB_OUTPUT

- name: Install Dependencies
run: npm ci

- name: Use Original NPM Version
id: original-npm-version
run: npm install -g npm@${{ steps.npm-version.outputs.number || '9' }}

- name: Install Rust toolchain
id: install-rust
if: github.event.inputs.test-type == 'binary' || github.event_name == 'push'
if: github.event.inputs.test-type != 'nodejs'
uses: dtolnay/rust-toolchain@stable

- name: Build Source
Expand All @@ -88,22 +86,22 @@ jobs:

- name: Build Binary
id: build-binary
if: matrix.os != 'windows-latest' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push')
if: matrix.os != 'windows-latest' && github.event.inputs.test-type != 'nodejs'
run: |
cargo build --verbose ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml
tar -cvzf zowe.tgz -C zowex/target/${{ github.event.inputs.binary-type == 'release' && 'release' || 'debug' }} zowe
- name: Build Binary (Windows)
id: build-windows-binary
if: matrix.os == 'windows-latest' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push')
if: matrix.os == 'windows-latest' && github.event.inputs.test-type != 'nodejs'
run: |
cargo build --verbose ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml
tar -cvzf zowe.tgz -C zowex/target/${{ github.event.inputs.binary-type == 'release' && 'release' || 'debug' }} zowe.exe
env:
RUSTFLAGS: "-Ctarget-feature=+crt-static"

- name: Archive Binary
if: github.event.inputs.test-type == 'binary' || github.event_name == 'push'
if: github.event.inputs.test-type != 'nodejs'
id: upload-binary
uses: actions/upload-artifact@v4
with:
Expand All @@ -112,7 +110,7 @@ jobs:
overwrite: true

- name: Setup Binary in PATH
if: github.event.inputs.test-type == 'binary' || github.event_name == 'push'
if: github.event.inputs.test-type != 'nodejs'
id: setup-binary
shell: bash
run: |
Expand All @@ -121,7 +119,7 @@ jobs:
- name: Test Rust EXE and zowe script
id: test-exe-and-script
if: ${{ steps.setup-binary.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
if: ${{ steps.setup-binary.outcome == 'success' && github.event.inputs.test-type != 'nodejs' }}
run: cargo test ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml -- --nocapture

- name: Unit Tests
Expand All @@ -135,16 +133,17 @@ jobs:

- name: Start Daemon
id: start-daemon
if: ${{ always() && steps.build.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
if: ${{ always() && steps.build.outcome == 'success' && github.event.inputs.test-type != 'nodejs' }}
run: ./__tests__/__resources__/daemon_instances/zowe

- name: Integration Tests (Native)
if: ${{ always() && steps.build.outcome == 'success' && !(github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
if: ${{ always() && steps.build.outcome == 'success' && github.event.inputs.test-type == 'nodejs' }}
run: npm run test:integration

- name: Integration Tests (Daemon)
if: ${{ always() && steps.build.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
run: npm run test:integration -- --runInBand
if: ${{ always() && steps.build.outcome == 'success' && github.event.inputs.test-type != 'nodejs' }}
# We need double double hyphen to work around Windows + Node 22 bug: https://github.com/npm/cli/issues/7375
run: npm run test:integration -- -- --runInBand

- name: Archive Results
if: ${{ always() && steps.build.outcome == 'success' }}
Expand Down

0 comments on commit 8d1dc81

Please sign in to comment.