Update dockerhub.yml #38
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: Test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '*' | |
paths: | |
- '**' | |
- '!**.md' | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- '**' | |
- '!**.md' | |
jobs: | |
Ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: docker build -t wg . -f Dockerfile | |
- name: Test single container | |
run: | | |
docker run --rm -id \ | |
--name cf_warp \ | |
--sysctl net.ipv6.conf.all.disable_ipv6=0 \ | |
--privileged --cap-add net_admin \ | |
-v /lib/modules:/lib/modules \ | |
-v $(pwd)/cf-warp:/var/lib/cloudflare-warp \ | |
wg | |
while ! docker logs cf_warp | grep "OK, cf-warp is up"; do | |
if [[ $(docker logs cf_warp) =~ "No such container" ]]; then exit 1; fi; | |
echo wait | |
sleep 1 | |
done | |
docker exec -i cf_warp curl -s4 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker exec -i cf_warp curl -s6 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker run --rm --network container:cf_warp curlimages/curl curl -s4 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker run --rm --network container:cf_warp curlimages/curl curl -s6 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker stop cf_warp | |
- name: Test single container V4 | |
run: | | |
docker run --rm -id \ | |
--name cf_warp \ | |
--sysctl net.ipv6.conf.all.disable_ipv6=0 \ | |
--privileged --cap-add net_admin \ | |
-v /lib/modules:/lib/modules \ | |
-v $(pwd)/cf_warp:/var/lib/cloudflare-warp \ | |
wg -4 | |
while ! docker logs cf_warp | grep "OK, cf-warp is up"; do | |
if [[ $(docker logs cf_warp) =~ "No such container" ]]; then exit 1; fi; | |
echo wait | |
sleep 1 | |
done | |
docker exec -i cf_warp curl -s4 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker run --rm --network container:cf_warp curlimages/curl curl -s4 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker stop cf_warp | |
- name: Test single container V6 | |
run: | | |
docker run --rm -id \ | |
--name cf_warp \ | |
--sysctl net.ipv6.conf.all.disable_ipv6=0 \ | |
--privileged --cap-add net_admin \ | |
-v /lib/modules:/lib/modules \ | |
-v $(pwd)/cf_warp:/var/lib/cloudflare-warp \ | |
wg -6 | |
while ! docker logs cf_warp | grep "OK, cf-warp is up"; do | |
if [[ $(docker logs cf_warp) =~ "No such container" ]]; then exit 1; fi; | |
echo wait | |
sleep 1 | |
done | |
docker exec -i cf_warp curl -s6 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker run --rm --network container:cf_warp curlimages/curl curl -s6 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker stop cf_warp | |
Ubuntu-HostMode: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: docker build -t wg . -f Dockerfile | |
- name: Test single container | |
run: | | |
docker run --rm -id \ | |
--name cf_warp \ | |
--net=host \ | |
--privileged --cap-add net_admin \ | |
-v /lib/modules:/lib/modules \ | |
-v /etc/resolv.conf:/etc/resolv.conf \ | |
-v $(pwd)/cf_warp:/var/lib/cloudflare-warp \ | |
wg | |
while ! docker logs cf_warp | grep "OK, cf-warp is up"; do | |
if [[ $(docker logs cf_warp) =~ "No such container" ]]; then exit 1; fi; | |
echo wait | |
sleep 1 | |
done | |
curl -s4 https://www.cloudflare.com/cdn-cgi/trace/ | |
curl -s6 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker stop cf_warp | |
- name: Test single container V4 | |
run: | | |
docker run --rm -id \ | |
--name cf_warp \ | |
--net=host \ | |
--privileged --cap-add net_admin \ | |
-v /lib/modules:/lib/modules \ | |
-v /etc/resolv.conf:/etc/resolv.conf \ | |
-v $(pwd)/cf_warp:/var/lib/cloudflare-warp \ | |
wg -4 | |
while ! docker logs cf_warp | grep "OK, cf-warp is up"; do | |
if [[ $(docker logs cf_warp) =~ "No such container" ]]; then exit 1; fi; | |
echo wait | |
sleep 1 | |
done | |
curl -s4 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker stop cf_warp | |
- name: Test single container V6 | |
run: | | |
docker run --rm -id \ | |
--name cf_warp \ | |
--net=host \ | |
--privileged --cap-add net_admin \ | |
-v /lib/modules:/lib/modules \ | |
-v /etc/resolv.conf:/etc/resolv.conf \ | |
-v $(pwd)/cf_warp:/var/lib/cloudflare-warp \ | |
wg -6 | |
while ! docker logs cf_warp | grep "OK, cf-warp is up"; do | |
if [[ $(docker logs cf_warp) =~ "No such container" ]]; then exit 1; fi; | |
echo wait | |
sleep 1 | |
done | |
curl -s6 https://www.cloudflare.com/cdn-cgi/trace/ | |
docker stop cf_warp |