build(deps): bump github.com/pion/interceptor from 0.1.30 to 0.1.31 #244
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
jobs: | |
build_multi_platform: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Build for multi-platform | |
run: | | |
set -xeu | |
DIST=dist | |
mkdir $DIST | |
# (from: https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04) | |
platforms=("linux/amd64" "darwin/amd64" "windows/amd64" "linux/arm") | |
for platform in "${platforms[@]}" | |
do | |
platform_split=(${platform//\// }) | |
export GOOS=${platform_split[0]} | |
export GOARCH=${platform_split[1]} | |
[ $GOOS = "windows" ] && EXTENSION='.exe' || EXTENSION='' | |
BUILD_PATH=webrtc-piping-$GOOS-$GOARCH | |
mkdir $BUILD_PATH | |
# Build | |
CGO_ENABLED=0 go build -o "${BUILD_PATH}/webrtc-piping${EXTENSION}" main.go | |
done | |
- run: tar czf webrtc-piping.tar.gz webrtc-piping-* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: built_executable | |
path: webrtc-piping.tar.gz | |
operational_test: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 2 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Run Nginx | |
run: docker run -d -p 8888:80 nginx:alpine | |
- name: Run Piping Server | |
run: docker run -d -p 8080:8080 nwtgck/piping-server:v1.12.4 | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- run: CGO_ENABLED=0 go build -o webrtc-piping main.go | |
- name: TCP tunnel | |
run: | | |
set -eux | |
./webrtc-piping -s http://localhost:8080 tunnel 8888 mypath & | |
./webrtc-piping -s http://localhost:8080 tunnel -l 9999 mypath & | |
sleep 1 | |
curl -fsS localhost:9999 | |
curl -fsS localhost:9999 | |
- name: Duplex communication | |
run: | | |
set -eux | |
(echo hello1 | ./webrtc-piping -s http://localhost:8080 duplex path1 path2 > peer1-out.txt) & | |
(echo hello2 | ./webrtc-piping -s http://localhost:8080 duplex path2 path1 > peer2-out.txt) & | |
sleep 1 | |
diff <(echo hello2) peer1-out.txt | |
diff <(echo hello1) peer2-out.txt | |
- name: Peer1 TCP tunneling | |
run: | | |
set -eu | |
path=$(echo ${{ secrets.PATH_SALT }} ${{ github.sha }} | sha256sum | cut -d' ' -f1) | |
./webrtc-piping -s https://ppng.io --ice-servers='[{"urls": "stun:stun.l.google.com:19302"}]' tunnel 8888 ${path} & | |
sleep 10 | |
operational_test_peer2: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 2 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- run: CGO_ENABLED=0 go build -o webrtc-piping main.go | |
- name: Peer2 TCP tunneling | |
run: | | |
set -eu | |
path=$(echo ${{ secrets.PATH_SALT }} ${{ github.sha }} | sha256sum | cut -d' ' -f1) | |
./webrtc-piping -s https://ppng.io --ice-servers='[{"urls": "stun:stun.l.google.com:19302"}]' tunnel -l 9999 ${path} & | |
sleep 1 | |
curl -fsS localhost:9999 | |
curl -fsS localhost:9999 |