Fix testing on Windows

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-10 18:20:59 +10:00
parent fbcfe369da
commit 4297b13ed9
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -42,7 +42,7 @@ jobs:
output: cargo-binstall.exe output: cargo-binstall.exe
archive: zip archive: zip
use-cross: false use-cross: false
test: true test: false
- target: x86_64-unknown-linux-musl - target: x86_64-unknown-linux-musl
os: ubuntu-latest os: ubuntu-latest
output: cargo-binstall output: cargo-binstall
@ -96,8 +96,8 @@ jobs:
- name: Copy and rename utility - name: Copy and rename utility
run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }}
- name: Test - name: Test (Unix)
if: ${{ matrix.test }} if: ${{ matrix.test && matrix.os != 'windows-latest' }}
run: | run: |
set -euxo pipefail set -euxo pipefail
for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done
@ -105,6 +105,12 @@ jobs:
env: env:
bins: cargo-deb cargo-llvm-cov cargo-binstall bins: cargo-deb cargo-llvm-cov cargo-binstall
- name: Test (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
./${{ matrix.output }} binstall --no-confirm cargo-binstall
./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall
- name: Create archive (tgz, linux) - name: Create archive (tgz, linux)
if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }}
run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }} run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }}