Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests on deb/rpm packages #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,58 @@ jobs:
./*.rpm
!./*-debuginfo-*.rpm

test-linux-packages:
needs: build-linux-packages
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- os: ubuntu-22.04
image: debian:stretch
pkg: deb
- os: ubuntu-22.04
image: debian:buster
pkg: deb
- os: ubuntu-22.04
image: debian:bullseye
pkg: deb
- os: ubuntu-22.04
image: debiaa:bookworm
pkg: deb
- os: ubuntu-22.04
image: ubuntu:xenial
pkg: deb
- os: ubuntu-22.04
image: ubuntu:bionic
pkg: deb
- os: ubuntu-22.04
image: ubuntu:focal
pkg: deb
- os: ubuntu-22.04
image: ubuntu:jammy
pkg: deb
- os: ubuntu-22.04
image: centos:7
pkg: rpm
- os: ubuntu-22.04
image: rockylinux:8
pkg: rpm
- os: ubuntu-22.04
image: rockylinux:9
pkg: rpm
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: artifact-${{ matrix.os }}-amd64
- uses: actions/download-artifact@v3
with:
name: artifact-${{ matrix.os }}-arm64
- name: Testing the package
run: |
file=$(ls *.${{ matrix.pkg }} | head -n 1)
bin/test_package "${{ matrix.image }}" "$file"

create-release:
runs-on: ubuntu-22.04
needs:
Expand Down
3 changes: 3 additions & 0 deletions bin/test_deb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
file=$1
dpkg -i $file
21 changes: 21 additions & 0 deletions bin/test_package
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
image=$1
file=$2

container=test-package
docker create --name $container --entrypoint sh -it "$image"
docker start $container
docker cp "$file" $container:"/$file"

if [[ $file =~ deb$ ]]; then
docker exec $container 'apt-get update && apt-get install -y bash'
docker cp bin/test_deb $container:/
docker exec $container "/test_deb /$file"
else
docker exec 'yum update && yum install -y bash'
docker cp bin/test_rpm $container:/
docker exec $container "/test_rpm /$file"
fi

docker rm -f $container

3 changes: 3 additions & 0 deletions bin/test_rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
file=$1
rpm -i $file