ci: add step to install and test package binaries
fixes: #7774 Signed-off-by: Louis Labeyrie <labeyrielouis@gmail.com>
This commit is contained in:
committed by
Chris Rizzitello
parent
f9d7c75492
commit
b33eb0135d
49
.github/actions/test-package/action.yml
vendored
Normal file
49
.github/actions/test-package/action.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: "Test Package"
|
||||
description: "Installs the built package and verifies the installed binaries can run"
|
||||
|
||||
inputs:
|
||||
like:
|
||||
description: "Used only on linux distro type: debian, fedora, suse, arch"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: Test package
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "macOS" ]; then
|
||||
dmg=$(ls build/deskflow-*.dmg | head -1)
|
||||
echo "Y" | hdiutil attach "$dmg" -nobrowse -mountpoint /tmp/deskflow-dmg
|
||||
/tmp/deskflow-dmg/Deskflow.app/Contents/MacOS/deskflow-core --version
|
||||
hdiutil detach /tmp/deskflow-dmg
|
||||
|
||||
elif [ "$RUNNER_OS" == "Windows" ]; then
|
||||
7z x build/deskflow-*-portable.7z -otmp/deskflow-pkg
|
||||
exe=$(find tmp/deskflow-pkg -name "deskflow-core.exe" -type f | head -1)
|
||||
exe_dir=$(dirname "$exe")
|
||||
pkg_root=$(dirname "$exe_dir")
|
||||
export PATH="$exe_dir:$pkg_root:$pkg_root/lib:$PATH"
|
||||
"$exe" --version
|
||||
|
||||
elif [ "$RUNNER_OS" == "Linux" ]; then
|
||||
if [ "${{inputs.like}}" == "debian" ]; then
|
||||
apt-get install -y ./build/deskflow-*.deb
|
||||
elif [ "${{inputs.like}}" == "fedora" ]; then
|
||||
dnf install -y build/deskflow-*.rpm
|
||||
elif [ "${{inputs.like}}" == "suse" ]; then
|
||||
zypper install -y --allow-unsigned-rpm build/deskflow-*.rpm
|
||||
elif [ "${{inputs.like}}" == "arch" ]; then
|
||||
pacman -U --noconfirm build/deskflow-*.pkg.tar.zst
|
||||
else
|
||||
echo "Unknown like: ${{inputs.like}}"
|
||||
exit 1
|
||||
fi
|
||||
deskflow-core --version
|
||||
|
||||
else
|
||||
echo "Unknown OS: $RUNNER_OS"
|
||||
exit 1
|
||||
fi
|
||||
5
.github/workflows/continuous-integration.yml
vendored
5
.github/workflows/continuous-integration.yml
vendored
@ -298,6 +298,11 @@ jobs:
|
||||
with:
|
||||
job: ${{ matrix.target.name }}
|
||||
|
||||
- name: Test package
|
||||
uses: ./.github/actions/test-package
|
||||
with:
|
||||
like: ${{ matrix.target.like }}
|
||||
|
||||
- name: Update Development Documentation
|
||||
if: matrix.target.like == 'arch' && github.ref == 'refs/heads/master'
|
||||
uses: JamesIves/github-pages-deploy-action@v4.7.3
|
||||
|
||||
Reference in New Issue
Block a user