From d2a4fcd6fc537a20993b1a1ba8355d22329dce91 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 26 Dec 2024 11:41:24 -0500 Subject: [PATCH] More workflow fixes and remove redundant tests Signed-off-by: Timothy Johnson --- .github/workflows/zowe-cli.yml | 20 ++++---------------- zowex/.cargo/config.toml | 2 ++ 2 files changed, 6 insertions(+), 16 deletions(-) create mode 100644 zowex/.cargo/config.toml diff --git a/.github/workflows/zowe-cli.yml b/.github/workflows/zowe-cli.yml index dd67a014d7..d37d5d37a0 100644 --- a/.github/workflows/zowe-cli.yml +++ b/.github/workflows/zowe-cli.yml @@ -84,24 +84,17 @@ jobs: - name: Build Binary id: build-binary - 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 }} zowe - - - name: Build Binary (Windows) - id: build-windows-binary - if: matrix.os == 'windows-latest' && github.event.inputs.test-type != 'nodejs' + if: 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 }} zowe.exe - env: - RUSTFLAGS: "-Ctarget-feature=+crt-static" + tar -cvzf zowe.tgz -C zowex/target/${{ github.event.inputs.binary-type || 'debug' }} ${{ matrix.os == 'windows-latest' && 'zowe.exe' || 'zowe' }} - name: Archive Binary if: github.event.inputs.test-type != 'nodejs' id: upload-binary uses: actions/upload-artifact@v4 + # Ignore conflict if multiple jobs upload artifact at same time: https://github.com/actions/upload-artifact/issues/506 + continue-on-error: true with: name: zowe-${{ matrix.os }}.tgz path: zowe.tgz @@ -115,11 +108,6 @@ jobs: tar -xvzf zowe.tgz -C ./__tests__/__resources__/daemon_instances echo "${{ github.workspace }}/__tests__/__resources__/application_instances" >> $GITHUB_PATH - - name: Test Rust EXE and zowe script - id: test-exe-and-script - 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 if: ${{ always() && steps.build.outcome == 'success' }} run: npm run test:unit diff --git a/zowex/.cargo/config.toml b/zowex/.cargo/config.toml new file mode 100644 index 0000000000..d6d7ccc38a --- /dev/null +++ b/zowex/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.'cfg(all(windows, target_env = "msvc"))'] +rustflags = ["-Ctarget-feature=+crt-static"] \ No newline at end of file