Merge pull request #178 from NobodyXu/ci

This commit is contained in:
Félix Saparelli 2022-06-11 21:57:38 +12:00 committed by GitHub
commit c33f195d5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 6 deletions

View file

@ -98,18 +98,15 @@ jobs:
- name: Test (Unix)
if: ${{ matrix.test && matrix.os != 'windows-latest' }}
run: |
set -euxo pipefail
for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done
./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall
env:
bins: cargo-deb cargo-llvm-cov cargo-binstall
run: ./ci-scripts/run_tests_unix.sh ${{ matrix.output }}
- name: Test (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
./${{ matrix.output }} binstall --no-confirm cargo-binstall
cargo binstall --help
./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall
cargo binstall --help
- name: Create archive (tgz, linux)
if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }}

22
ci-scripts/run_tests_unix.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
set -euxo pipefail
bins="cargo-deb cargo-llvm-cov cargo-binstall"
test_bins="cargo-deb cargo-llvm-cov"
# Install binaries using cargo-binstall
for bin in $bins; do
"./$1" binstall --log-level debug --no-confirm "$bin"
done
# Test that the installed binaries can be run
for bin in $test_bins; do
"$HOME/.cargo/bin/$bin" --version
done
cargo binstall --help >/dev/null
# Install binaries using `--manifest-path`
"./$1" binstall --log-level debug --manifest-path . --no-confirm cargo-binstall
# Test that the installed binaries can be run
cargo binstall --help >/dev/null

View file

@ -44,6 +44,8 @@ fn untar<Filter: FnMut(&Path) -> bool>(
tar.unpack(path)?;
}
debug!("Untaring completed");
Ok(())
}