From 92af746a735a11d9292aa46d7a07cd17468d11e0 Mon Sep 17 00:00:00 2001 From: Daniel Poelzleithner Date: Thu, 9 Dec 2021 13:50:41 +0100 Subject: [PATCH] Enable CI --- .github/workflows/build.yaml | 17 +++++++++++++++++ tests/exclude-rsyncssh.lua | 4 ++++ tests/testlib.lua | 10 ++++++---- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..691c023 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,17 @@ +name: "Build" +on: + pull_request: + push: +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + version: + - lsyncd_lua5_3 + steps: + - uses: actions/checkout@v2.4.0 + - uses: cachix/install-nix-action@v15 + - run: | + chmod og-rw ~ + nix develop .#${{ matrix.version }} --command ./tests/ci-run.sh \ No newline at end of file diff --git a/tests/exclude-rsyncssh.lua b/tests/exclude-rsyncssh.lua index b9d8aa0..b5efcbc 100644 --- a/tests/exclude-rsyncssh.lua +++ b/tests/exclude-rsyncssh.lua @@ -27,6 +27,10 @@ sync { ssh = { port= 2468, identityFile = "]] .. script_path() .. [[/ssh/id_rsa", + options = { + StrictHostKeyChecking="no", + UserKnownHostsFile="/dev/null", + }, }, source = ']]..srcdir..[[', targetdir = ']]..trgdir..[[', diff --git a/tests/testlib.lua b/tests/testlib.lua index 42eb77b..34fee4e 100644 --- a/tests/testlib.lua +++ b/tests/testlib.lua @@ -137,7 +137,7 @@ function startSshd() end local f = io.open( sshdPath .. "sshd_config", 'w') - f:write([[ + local cfg = [[ Port 2468 HostKey ]] .. sshdPath .. [[ssh_host_rsa_key AuthorizedKeysFile ]] .. sshdPath .. [[authorized_keys @@ -145,13 +145,15 @@ function startSshd() UsePAM no #Subsystem sftp /usr/lib/ssh/sftp-server PidFile ]] .. sshdPath .. [[sshd.pid - ]]) - f:close( ) + ]] + cwriteln("Use ssh config: "..cfg) + f:write(cfg) + f:close() --local which = io.popen("which sshd") exePath = which('sshd') cwriteln("Using sshd: "..exePath) - local pid = spawn(exePath, "-f", sshdPath .. "sshd_config") + local pid = spawn(exePath, "-D", "-e", "-f", sshdPath .. "sshd_config") cwriteln( 'spawned sshd server: ' .. pid) return true