Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/setup-warp/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Setup WARP'
description: 'Install and configure Cloudflare WARP on GitHub Actions runners'
author: 'ipspot@openscilab.com'

runs:
using: "composite"
steps:
- name: Install and configure WARP
shell: bash
run: |
echo "WARP mode: client warp+doh."
sudo apt-get -y update
curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list
sudo apt-get update
sudo apt-get install -y cloudflare-warp
sudo warp-cli --accept-tos registration new
sudo warp-cli --accept-tos connect

# Test IPv6 connectivity
sleep 1
echo "Testing IPv6 connectivity..."
sudo curl -s6 --retry 3 -A Mozilla https://api64.ipify.org || echo "IPv6 not available"
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
python-version: [3.7, 3.8, 3.9, 3.10.5, 3.11.0, 3.12.0, 3.13.0]
steps:
- uses: actions/checkout@v2
# Setup WARP (Ubuntu only)
- name: Setup WARP
if: matrix.os == 'ubuntu-22.04'
uses: ./.github/actions/setup-warp
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -58,7 +62,14 @@ jobs:
pip install --upgrade --upgrade-strategy=only-if-needed -r test-requirements.txt
- name: Test with pytest
run: |
python -m pytest . --cov=ipspot --cov-report=term
OS="${{ matrix.os }}"
TEST_OS="${{ env.TEST_OS }}"
if [[ "$OS" == "$TEST_OS" ]]; then
python -m pytest . --cov=ipspot --cov-report=term
else
python -m pytest . --cov=ipspot --cov-report=term --ignore=tests/test_ipv6.py
fi
shell: bash
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]
### Added
- `Setup WARP` step in `test.yml`
- `setup-warp` action
- Support [ipwho.is](https://ipwho.is/)
- Support [ipquery.io](http://api.ipquery.io/?format=json)
- Support [wtfismyip.com](https://wtfismyip.com/json)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ipv4.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_public_ipv4_my_ip_io_net_error():


def test_public_ipv4_ifconfig_co_success():
result = get_public_ipv4(api=IPv4API.IFCONFIG_CO, geo=True)
result = get_public_ipv4(api=IPv4API.IFCONFIG_CO, geo=True, timeout=20)
assert result["status"]
assert is_ipv4(result["data"]["ip"])
assert set(result["data"].keys()) == DATA_ITEMS
Expand Down
Loading