Skip to content

Commit f5f8566

Browse files
committed
Add github actions for basic testing
Add basic tests to ensure E.L.B.E. is building and can be installed: - Build Debian Stable packages - Build Debian Unstable packages - Build Ubuntu packages and install all packages Signed-off-by: Benedikt Spranger <[email protected]>
1 parent 986d4a2 commit f5f8566

File tree

6 files changed

+135
-0
lines changed

6 files changed

+135
-0
lines changed

.github/scripts/install_all.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/bash
2+
3+
ARCH="$(dpkg-architecture -q DEB_BUILD_ARCH)"
4+
DIST="$(. /etc/os-release; echo ${VERSION_CODENAME/*, /})"
5+
6+
cd repo
7+
reprepro list "$DIST" | awk '{print "sudo apt-get install -y "$2}' | sh

.github/scripts/setup_repo.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /bin/bash
2+
3+
ARCH="$(dpkg-architecture -q DEB_BUILD_ARCH)"
4+
DIST="$(. /etc/os-release; echo ${VERSION_CODENAME/*, /})"
5+
6+
mkdir repo
7+
cp -a .github/templates/reprepro/* repo
8+
cd repo
9+
10+
find . -type f -exec sed -i -e "s/@ARCH@/${ARCH}/" -e "s/@DIST@/${DIST}/" {} \;
11+
12+
reprepro --ignore=wrongdistribution include "$DIST" ../../*_${ARCH}.changes
13+
reprepro --ignore=wrongdistribution include "$DIST" ../contrib/*_${ARCH}.changes
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#! /bin/bash
2+
3+
DIST="$(. /etc/os-release; echo ${VERSION_CODENAME/*, /})"
4+
5+
echo "deb [trusted=yes] file://$(pwd)/repo ${DIST} main" \
6+
> /etc/apt/sources.list.d/elbe.list
7+
8+
apt-get update
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Origin: elbe
2+
Label: elbe
3+
Codename: @DIST@
4+
Architectures: source @ARCH@
5+
Components: main
6+
Description: E.L.B.E. packages repository (unsafe)
7+
# SignWith: 8044921302364FBDC541F38971F7AE8C018CE6CB
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
verbose
2+
ask-passphrase

.github/workflows/main.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: "E.L.B.E. test runner"
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull
4+
# request events but only for the master branch
5+
on:
6+
workflow_dispatch: {}
7+
push:
8+
branches:
9+
- master
10+
- 'devel/**'
11+
pull_request:
12+
branches:
13+
- master
14+
- 'devel/**'
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or
17+
# in parallel
18+
jobs:
19+
Build-for-stable:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Build E.L.B.E. Debian stable packages
25+
uses: jtdor/[email protected]
26+
with:
27+
docker-image: debian:stable-slim
28+
artifacts-dir: stable
29+
30+
- name: Retrieve results
31+
if: ${{ always() }}
32+
uses: actions/upload-artifact@v3
33+
with:
34+
name: stable
35+
path: |
36+
stable/
37+
if-no-files-found: warn
38+
39+
Build-for-unstable:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v3
43+
44+
- name: Build E.L.B.E. Debian stable packages
45+
uses: jtdor/[email protected]
46+
with:
47+
docker-image: debian:unstable-slim
48+
artifacts-dir: unstable
49+
50+
- name: Retrieve results
51+
if: ${{ always() }}
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: unstable
55+
path: |
56+
unstable/
57+
if-no-files-found: warn
58+
59+
Run-on-Ubuntu:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v3
63+
64+
- name: Install tools
65+
run: sudo apt-get install -y config-package-dev devscripts git-buildpackage lighttpd reprepro
66+
67+
- name: Create build environment
68+
run: ARCH="$(dpkg-architecture -q DEB_BUILD_ARCH)" DIST="$(. /etc/os-release; echo ${VERSION_CODENAME/*, /})" git-pbuilder create
69+
70+
- name: Build E.L.B.E. packages
71+
run: gbp buildpackage -nc --git-debian-branch="$(git branch --show-current)" --git-pbuilder --git-dist="$(. /etc/os-release; echo ${VERSION_CODENAME/*, /})" --git-arch="$(dpkg-architecture -q DEB_BUILD_ARCH)"
72+
73+
- name: Build configuration package
74+
run: cd contrib/debathena-transform-lighttpd; ARCH="$(dpkg-architecture -q DEB_BUILD_ARCH)" DIST="$(. /etc/os-release; echo ${VERSION_CODENAME/*, /})" git-pbuilder -nc
75+
76+
- name: Build Repo
77+
run: ./.github/scripts/setup_repo.sh
78+
79+
- name: Retrieve results
80+
if: ${{ always() }}
81+
uses: actions/upload-artifact@v3
82+
with:
83+
name: repo
84+
path: |
85+
repo/
86+
if-no-files-found: warn
87+
88+
- name: Prepare to use Repo
89+
run: sudo ./.github/scripts/update_sources_list.sh
90+
91+
- name: Install E.L.B.E.
92+
run: sudo apt-get install -y elbe
93+
94+
- name: Show E.L.B.E. version
95+
run: elbe --version
96+
97+
- name: Install all E.L.B.E. packages
98+
run: sudo ./.github/scripts/install_all.sh

0 commit comments

Comments
 (0)