Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/e2e/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
docker-sshd-e2e-target:
image: alpine:3.20
container_name: docker-sshd-e2e-test
command: ["sleep", "300"]
48 changes: 48 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: e2e

on:
push:
tags:
- v*
branches:
- master
pull_request:

permissions:
contents: read

jobs:
e2e:
name: e2e
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: '1.26.x'
cache: true

- name: Run docker-sshd e2e check
run: |
docker compose -f .github/e2e/docker-compose.yml up -d
sshd_pid=""
trap "test -n \"${sshd_pid}\" && kill ${sshd_pid} || true; docker compose -f .github/e2e/docker-compose.yml down || true" EXIT
ssh-keygen -t ed25519 -N '' -f /tmp/docker-sshd-e2e-key > /dev/null
go run ./cmd/docker-sshd --address 127.0.0.1 --port 2232 --server-key /tmp/docker-sshd-e2e-key &
sshd_pid=$!
output=""
for _ in $(seq 1 20); do
output="$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=none -p 2232 docker-sshd-e2e-test@127.0.0.1 echo ok)" && break
sleep 1
done
test "${output}" = "ok" || (echo "docker-sshd e2e failed: expected 'ok', got '${output}'" && exit 1)

- name: Run kube-sshd smoke check
run: |
go run ./cmd/kube-sshd --help > /dev/null
22 changes: 0 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,3 @@ jobs:

- name: Run unit tests
run: go test ./...

e2e:
name: e2e
runs-on: ubuntu-latest
needs: ut
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: '1.26.x'
cache: true

- name: Run e2e smoke checks
run: |
go run ./cmd/docker-sshd --help > /dev/null
go run ./cmd/kube-sshd --help > /dev/null
Loading