Skip to content

Commit

Permalink
Add initial github tests
Browse files Browse the repository at this point in the history
Signed-off-by: Corentin Labbe <[email protected]>
  • Loading branch information
montjoie committed Oct 11, 2024
1 parent 0eead3d commit 186fa23
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# yamllint disable rule:line-length
name: tests yasat

on: # yamllint disable-line rule:truthy
push:
pull_request:

jobs:
test-ubuntu:
runs-on: ubuntu-latest
name: test on ubuntu
steps:
- uses: actions/checkout@v4
- name: update pkglist
run: sudo apt-get update
- name: Run yasat
run: |
./yasat
ubuntu-pkg:
runs-on: ubuntu-latest
name: build ubuntu package
steps:
- uses: actions/checkout@v4
- name: update pkglist
run: sudo apt-get update
- name: Install packages
run: sudo apt-get -y install devscripts gnupg debhelper-compat
- name: create orig targz
run: cd .. && tar czf yasqt_0-1.orig.tar.gz yasat
- name: Run ls
run: ls -l
- name: Run debuild
run: debuild -i -us -uc -b

14 changes: 14 additions & 0 deletions common
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,20 @@ Is_installed_via_package_manager()
return 0;
fi
if [ "$LIST_PKG" = "emerge" ] ;then
if [ -z "$CACHE_EMERGE_OK" ];then
# check if we have can use portage
emerge --info 2>/dev/null >/dev/null
if [ $? -ne 0 ];then
Display --indent 2 --text "Could not work with emerge (cached)" --result EPERM --color RED
CACHE_EMERGE_OK="ko"
return 0
fi
fi
if [ "$CACHE_EMERGE_OK" = 'ko' ];then
Display --indent 2 --text "Could not work with emerge (cached)" --result EPERM --color RED
return 0
fi
CACHE_EMERGE_OK="ok"
#TODO could be better
PKGLIST="`equery -C -q l $1`"
if [ -z "$PKGLIST" ] ;then
Expand Down
10 changes: 9 additions & 1 deletion plugins/apache_modules.test
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ fi
check_file "$APACHE_BIN" 2 BINARY

if [ "$LINUX_VERSION" = "Gentoo" ] ;then
. /etc/conf.d/apache2
if [ ! -r /etc/conf.d/apache2 ];then
TESTNAME='YASAT_TEST_APACHE_MODULES_READ_CONFD_APACHE Check if we can use /etc/conf.d/apache2'
Display --indent 2 --text "Cannot read /etc/conf.d/apache2" --result ERROR --color RED
else
. /etc/conf.d/apache2
if [ $? -ne 0 ];then
echo "ERROR: could not read /etc/conf.d/apache2"
fi
fi
APACHE_BIN="$APACHE_BIN $APACHE2_OPTS"
fi

Expand Down

0 comments on commit 186fa23

Please sign in to comment.