Skip to content

build(deps): bump actions/checkout from 4.1.5 to 4.1.6 (#28) #148

build(deps): bump actions/checkout from 4.1.5 to 4.1.6 (#28)

build(deps): bump actions/checkout from 4.1.5 to 4.1.6 (#28) #148

Workflow file for this run

name: CI
on: [push]
jobs:
build_and_operational_test:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- name: Run Nginx
run: docker run -d -p 8080:80 nginx:alpine
- run: sudo apt install -y socat
- name: Serve Unix-domain socket
run: socat UNIX-LISTEN:/tmp/my_nginx_socat,fork TCP:localhost:8080 &
- uses: actions/[email protected]
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Build
run: CGO_ENABLED=0 go build -o yamux
- name: Normal TCP
run: |
set -eu
mkfifo my_pipe
cat my_pipe | ./yamux localhost 8080 | ./yamux -l 8081 > ./my_pipe &
sleep 1
curl localhost:8080 > expected_response.txt
# HTTP GET request twice
diff expected_response.txt <(curl localhost:8081)
diff expected_response.txt <(curl localhost:8081)
kill %1
rm my_pipe
- name: Normal TCP specifying host when listening
run: |
set -eu
mkfifo my_pipe
cat my_pipe | ./yamux localhost 8080 | ./yamux -l localhost 8081 > ./my_pipe &
sleep 1
curl localhost:8080 > expected_response.txt
# HTTP GET request twice
diff expected_response.txt <(curl localhost:8081)
diff expected_response.txt <(curl localhost:8081)
kill %1
rm my_pipe
- name: Unix-domain socket (dial)
run: |
set -eu
mkfifo my_pipe
cat my_pipe | ./yamux -U /tmp/my_nginx_socat | ./yamux -l 8081 > ./my_pipe &
sleep 1
curl localhost:8080 > expected_response.txt
# HTTP GET request twice
diff expected_response.txt <(curl localhost:8081)
diff expected_response.txt <(curl localhost:8081)
kill %1
rm my_pipe
- name: Unix-domain socket (listen)
run: |
set -eu
mkfifo my_pipe
cat my_pipe | ./yamux localhost 8080 | ./yamux -l -U /tmp/my_unginx > ./my_pipe &
sleep 1
curl localhost:8080 > expected_response.txt
# HTTP GET request twice
diff expected_response.txt <(curl --unix-socket /tmp/my_unginx http:/index.html)
diff expected_response.txt <(curl --unix-socket /tmp/my_unginx http:/index.html)
kill %1
rm my_pipe
- name: UDP
run: |
set -eu
mkfifo my_pipe
cat my_pipe | ./yamux -u 1.1.1.1 53 | ./yamux -ul 1053 > ./my_pipe &
sleep 1
# DNS request twice
# NOTE: if 1053 port is not available they will be timeout errors
dig example.com @127.0.0.1 -p 1053
dig example.com @127.0.0.1 -p 1053
kill %1
rm my_pipe