Skip to content

Commit 4d53078

Browse files
committed
Very initial test package workflow skeleton
1 parent 5ea5070 commit 4d53078

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,58 @@ jobs:
368368
./*.rpm
369369
!./*-debuginfo-*.rpm
370370
371+
test-linux-packages:
372+
needs: build-linux-packages
373+
runs-on: ubuntu-22.04
374+
strategy:
375+
matrix:
376+
include:
377+
- os: ubuntu-22.04
378+
image: debian:stretch
379+
pkg: deb
380+
- os: ubuntu-22.04
381+
image: debian:buster
382+
pkg: deb
383+
- os: ubuntu-22.04
384+
image: debian:bullseye
385+
pkg: deb
386+
- os: ubuntu-22.04
387+
image: debiaa:bookworm
388+
pkg: deb
389+
- os: ubuntu-22.04
390+
image: ubuntu:xenial
391+
pkg: deb
392+
- os: ubuntu-22.04
393+
image: ubuntu:bionic
394+
pkg: deb
395+
- os: ubuntu-22.04
396+
image: ubuntu:focal
397+
pkg: deb
398+
- os: ubuntu-22.04
399+
image: ubuntu:jammy
400+
pkg: deb
401+
- os: ubuntu-22.04
402+
image: centos:7
403+
pkg: rpm
404+
- os: ubuntu-22.04
405+
image: rockylinux:8
406+
pkg: rpm
407+
- os: ubuntu-22.04
408+
image: rockylinux:9
409+
pkg: rpm
410+
steps:
411+
- uses: actions/checkout@v3
412+
- uses: actions/download-artifact@v3
413+
with:
414+
name: artifact-${{ matrix.os }}-amd64
415+
- uses: actions/download-artifact@v3
416+
with:
417+
name: artifact-${{ matrix.os }}-arm64
418+
- name: Testing the package
419+
run: |
420+
file=$(ls *.${{ matrix.pkg }} | head -n 1)
421+
bin/test_package "${{ matrix.image }}" "$file"
422+
371423
create-release:
372424
runs-on: ubuntu-22.04
373425
needs:

bin/test_deb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
file=$1
3+
dpkg -i $file

bin/test_package

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
image=$1
3+
file=$2
4+
5+
container=test-package
6+
docker create --name $container --entrypoint sh -it "$image"
7+
docker start $container
8+
docker cp "$file" $container:"/$file"
9+
10+
if [[ $file =~ deb$ ]]; then
11+
docker exec $container 'apt-get update && apt-get install -y bash'
12+
docker cp bin/test_deb $container:/
13+
docker exec $container "/test_deb /$file"
14+
else
15+
docker exec 'yum update && yum install -y bash'
16+
docker cp bin/test_rpm $container:/
17+
docker exec $container "/test_rpm /$file"
18+
fi
19+
20+
docker rm -f $container
21+

bin/test_rpm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
file=$1
3+
rpm -i $file

0 commit comments

Comments
 (0)