Add backwards compatibility CI job #119
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: Build and test | |
on: [ push ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.22' # The Go version to download (if necessary) and use. | |
- run: go test -race -coverprofile coverage.txt -coverpkg ./... -covermode atomic ./... | |
- uses: codecov/codecov-action@v1 | |
with: | |
file: coverage.txt | |
compat-test: | |
runs-on: ubuntu-latest | |
services: | |
cloak-server: | |
image: cbeuw/cloak:latest | |
options: build/ck-server -c config/ckserver.json --verbosity debug | |
volumes: | |
- config:config | |
ports: | |
- 80:80 | |
- 443:443 | |
iperf-server: | |
image: ajoergensen/iperf3:latest | |
options: --server | |
ports: | |
- 5201:5201 | |
steps: | |
- name: Create configs | |
run: | | |
mkdir config | |
cat << EOF > config/ckclient.json | |
{ | |
"Transport": "direct", | |
"ProxyMethod": "ssh", | |
"EncryptionMethod": "chacha20-poly1305", | |
"UID": "Q4GAXHVgnDLXsdTpw6bmoQ==", | |
"PublicKey": "4dae/bF43FKGq+QbCc5P/E/MPM5qQeGIArjmJEHiZxc=", | |
"ServerName": "cloudflare.com", | |
"BrowserSig": "firefox", | |
"NumConn": 4 | |
} | |
EOF | |
cat << EOF > config/ckserver.json | |
{ | |
"ProxyBook": { | |
"iperf": [ | |
"tcp", | |
"iperf-server:5201" | |
] | |
}, | |
"BindAddr": [ | |
":443", | |
":80" | |
], | |
"BypassUID": [ | |
"Q4GAXHVgnDLXsdTpw6bmoQ==" | |
], | |
"RedirAddr": "cloudflare.com", | |
"PrivateKey": "AAaskZJRPIAbiuaRLHsvZPvE6gzOeSjg+ZRg1ENau0Y=" | |
} | |
EOF | |
- name: Restart Cloak server | |
uses: docker://docker | |
with: | |
args: docker restart cloak-server | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.22' | |
- run: | | |
make client | |
build/ck-client -c config/ckclient.json -s cloak-server --verbosity debug & | |
iperf3 --client 127.0.0.1 -p 1080 |