Skip to content

Test 1286

Test 1286 #86

Workflow file for this run

name: 01-main Tests
on:
pull_request:
types: [opened, synchronize]
paths:
- "01-main/packages/*"
- "01-main/manifest"
- "!01-main/packages/*.html"
- "!01-main/packages/*.json"
- "!01-main/packages/timestamp"
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
# Dependencies for deb-get itself
sudo apt-get install apt apt-transport-https bash coreutils curl dpkg gpg grep libc-bin lsb-release sed software-properties-common sudo wget desktop-file-utils -y
- name: Initialize /etc/deb-get
run: |
sudo mkdir /etc/deb-get
echo "deb-get 1 github" | sudo tee /etc/deb-get/installed > /dev/null
sudo cp ./01-main/manifest /etc/deb-get/01-main.repo
sudo cp -r ./01-main/packages /etc/deb-get/01-main.d
sudo gpg -k > /dev/null
# Install added/changed packages to see if they install properly and are detected as such
- name: Test package installations
run: |
chmod a+x ./deb-get
export DEBIAN_FRONTEND=noninteractive
export DEBGET_TOKEN=${{ secrets.GITHUB_TOKEN }}
set -x
APPS="$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep "^01-main/packages/" | sed "s|^01-main/packages/||")"
SUPPORTED="$(./deb-get list --raw)"
for APP in ${APPS}; do
if echo "${SUPPORTED}" | grep -q -m 1 "^${APP}$"; then
./deb-get install "${APP}"
if ./deb-get show "${APP}" | grep -q "Installed: No"; then
echo "Failed to detect ${APP} as installed" >&2
exit 1
else
PUBLISHED_VER=$(./deb-get show "${APP}" | grep "Published:" | grep -oE '[^[:space:]]+$' || :)
INSTALLED_VER=$(dpkg-query -Wf '${Version}' "${APP}" || :)
if [ -n "${PUBLISHED_VER// /}" ] && dpkg --compare-versions "${PUBLISHED_VER// /}" gt "${INSTALLED_VER}" ; then
echo "Versions do not match. The package's VERSION_PUBLISHED variable may need to be changed." >&2
echo "Published Version: ${PUBLISHED_VER}"
echo "Installed Version: ${INSTALLED_VER}"
exit 1
else
./deb-get purge "${APP}"
fi
fi
fi
done