From b8e325289c9cffc58917186b373421957d2edacd Mon Sep 17 00:00:00 2001 From: LaserEyess Date: Mon, 3 Jun 2024 11:48:13 -0400 Subject: [PATCH] Add basic github actions --- .github/workflows/test.yml | 21 +++++++++++++++++++++ test/test_http.sh | 2 +- test/test_ssh.sh | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3ece084 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: install deps + run: | + sudo apt-get update + sudo apt-get install -y meson python3 libsystemd-dev curl openssh-client + - name: meson configure + run: meson setup build -Denable_tests=true + - name: meson test + run: meson test -C build || cat ./build/meson-logs/testlog.txt diff --git a/test/test_http.sh b/test/test_http.sh index 7669c5a..a42ed70 100755 --- a/test/test_http.sh +++ b/test/test_http.sh @@ -4,7 +4,7 @@ port=10080 systemd-socket-activate -l $port $1 --protocol http --log-level DEBUG --log-to-stdout & trap "kill -SIGTERM $!" SIGINT EXIT -timeout -s SIGINT 10 curl -v "http://localhost:${port}" +timeout -s SIGINT 10 curl -v "http://127.0.0.1:${port}" if [[ $? -ne 124 ]] then diff --git a/test/test_ssh.sh b/test/test_ssh.sh index 02abe05..7626ef8 100755 --- a/test/test_ssh.sh +++ b/test/test_ssh.sh @@ -4,7 +4,7 @@ port=10022 systemd-socket-activate -l $port $1 --protocol ssh --log-level DEBUG --log-to-stdout & trap "kill -SIGTERM $!" SIGINT EXIT -timeout -s SIGINT 10 ssh -v localhost -p $port +timeout -s SIGINT 10 ssh -v 127.0.0.1 -p $port if [[ $? -ne 124 ]] then