Merge pull request #35 from jordanpotter/ci-ip-check
Verify WireGuard IP address is different in CI
This commit is contained in:
commit
151215a763
1 changed files with 5 additions and 3 deletions
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -10,7 +10,7 @@ on:
|
||||||
concurrency: ${{ github.workflow }}
|
concurrency: ${{ github.workflow }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
publish:
|
||||||
name: Publish
|
name: Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
|
@ -46,10 +46,12 @@ jobs:
|
||||||
load: true
|
load: true
|
||||||
tags: wireguard
|
tags: wireguard
|
||||||
|
|
||||||
- name: Test curl
|
- name: Test tunnel
|
||||||
run: |
|
run: |
|
||||||
docker run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf wireguard
|
docker run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf wireguard
|
||||||
docker run --rm --net=container:wireguard curlimages/curl --retry 3 --retry-delay 5 ifconfig.io
|
normal_ip=$(docker run --rm curlimages/curl --retry 3 --retry-delay 5 ifconfig.io)
|
||||||
|
wireguard_ip=$(docker run --rm --net=container:wireguard curlimages/curl --retry 3 --retry-delay 5 ifconfig.io)
|
||||||
|
if [ "$normal_ip" = "$wireguard_ip" ]; then echo "normal ip and wireguard ip are the same" && exit 1; fi
|
||||||
docker stop wireguard
|
docker stop wireguard
|
||||||
|
|
||||||
- name: Test kill switch
|
- name: Test kill switch
|
||||||
|
|
Loading…
Reference in a new issue