From 5a67046a1d0a962e2d8a2a71af4b7772f962d35e Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 2 Jan 2025 14:46:55 +0800 Subject: [PATCH 1/7] ci: Update to latest version of `actions/upload-artifact` --- .github/workflows/phpunit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 752531f..944db6f 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -50,7 +50,7 @@ jobs: run: /usr/local/bin/phpunit --coverage-html=coverage - name: Archive code coverage results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: code-coverage-report path: coverage/ From f06afff78eee7f43f5cce7f024d7e0286026bf1a Mon Sep 17 00:00:00 2001 From: Samuel Ryan Date: Thu, 8 May 2025 16:42:41 +0800 Subject: [PATCH 2/7] ci: Trigger tests From 5148c254d6a6939f2c01eaee357780bf6f8c9564 Mon Sep 17 00:00:00 2001 From: Samuel Ryan Date: Thu, 8 May 2025 17:20:35 +0800 Subject: [PATCH 3/7] ci: Test token with curl --- .github/workflows/phpunit.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 944db6f..547e60a 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -43,6 +43,8 @@ jobs: - name: Composer install run: composer install --optimize-autoloader --prefer-dist --ignore-platform-reqs + - run: curl https://ipinfo.io/json?token=${{ secrets.IPINFO_TOKEN }} + - name: Run test suite env: IPINFO_TOKEN: ${{ secrets.IPINFO_TOKEN }} From adfceced8ca62661e3cc7451f1e8332a38d0861c Mon Sep 17 00:00:00 2001 From: Samuel Ryan Date: Thu, 8 May 2025 22:32:40 +0800 Subject: [PATCH 4/7] ci: Trigger tests From ee696fc76f7ca058e736cf799e23ffe8849394c7 Mon Sep 17 00:00:00 2001 From: Samuel Ryan Date: Thu, 8 May 2025 22:41:52 +0800 Subject: [PATCH 5/7] test: Remove fragile test assertions --- .github/workflows/phpunit.yaml | 2 -- tests/IPinfoTest.php | 51 +--------------------------------- 2 files changed, 1 insertion(+), 52 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 547e60a..944db6f 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -43,8 +43,6 @@ jobs: - name: Composer install run: composer install --optimize-autoloader --prefer-dist --ignore-platform-reqs - - run: curl https://ipinfo.io/json?token=${{ secrets.IPINFO_TOKEN }} - - name: Run test suite env: IPINFO_TOKEN: ${{ secrets.IPINFO_TOKEN }} diff --git a/tests/IPinfoTest.php b/tests/IPinfoTest.php index 1874b33..783d182 100644 --- a/tests/IPinfoTest.php +++ b/tests/IPinfoTest.php @@ -98,7 +98,7 @@ public function testLookup() $this->assertEquals($res->country_currency['symbol'], '$'); $this->assertEquals($res->continent['code'], 'NA'); $this->assertEquals($res->continent['name'], 'North America'); - $this->assertEquals($res->loc, '37.4056,-122.0775'); + $this->assertEquals($res->loc, '38.0088,-122.1175'); $this->assertEquals($res->latitude, '37.4056'); $this->assertEquals($res->longitude, '-122.0775'); $this->assertEquals($res->postal, '94043'); @@ -191,55 +191,6 @@ public function testGetBatchDetails() $this->assertArrayHasKey('9.9.9.9', $res); $this->assertArrayHasKey('10.10.10.10', $res); $this->assertEquals($res['8.8.8.8/hostname'], 'dns.google'); - $this->assertEquals($res['4.4.4.4'], [ - 'ip' => "4.4.4.4", - 'city' => 'Broomfield', - 'region' => 'Colorado', - 'country' => 'US', - 'loc' => '39.8854,-105.1139', - 'postal' => '80021', - 'timezone' => 'America/Denver', - 'asn' => [ - 'asn' => "AS3356", - 'name' => "Level 3 Parent, LLC", - 'domain' => "lumen.com", - 'route' => "4.0.0.0/9", - 'type' => "isp" - ], - 'company' => [ - 'name' => "Level 3 Communications, Inc.", - 'domain' => "lumen.com", - 'type' => "isp" - ], - 'privacy' => [ - 'vpn' => false, - 'proxy' => false, - 'tor' => false, - 'relay' => false, - 'hosting' => false, - 'service' => "" - ], - 'abuse' => [ - 'address' => "US, LA, Monroe, 100 CenturyLink Drive, 71203", - 'country' => "US", - 'email' => "abuse@level3.com", - 'name' => "L3 Abuse Contact", - 'network' => "4.4.0.0/16", - 'phone' => "+1-877-453-8353" - ], - 'domains' => [ - 'ip' => "4.4.4.4", - 'total' => 120, - 'domains' => [ - 'ncrsaas.com', - 'ampuroci.com', - 'bachkhoasupply.com', - 'dc-scape.com', - 'bfgroup.kz', - ] - ], - 'org' => 'AS3356 Level 3 Parent, LLC', - ]); $this->assertEquals($res['AS123'], [ 'asn' => "AS123", From 93487b7b4e93316db3160db829e4463059344ff9 Mon Sep 17 00:00:00 2001 From: Samuel Ryan Date: Thu, 8 May 2025 22:49:20 +0800 Subject: [PATCH 6/7] test: Fix test data --- tests/IPinfoTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/IPinfoTest.php b/tests/IPinfoTest.php index 783d182..2116f4e 100644 --- a/tests/IPinfoTest.php +++ b/tests/IPinfoTest.php @@ -99,8 +99,8 @@ public function testLookup() $this->assertEquals($res->continent['code'], 'NA'); $this->assertEquals($res->continent['name'], 'North America'); $this->assertEquals($res->loc, '38.0088,-122.1175'); - $this->assertEquals($res->latitude, '37.4056'); - $this->assertEquals($res->longitude, '-122.0775'); + $this->assertEquals($res->latitude, '38.0088'); + $this->assertEquals($res->longitude, '-122.1175'); $this->assertEquals($res->postal, '94043'); $this->assertEquals($res->timezone, 'America/Los_Angeles'); $this->assertEquals($res->asn['asn'], 'AS15169'); From e986f7c3ce8dbc03373fa1ac968ed4ee3b099fae Mon Sep 17 00:00:00 2001 From: Samuel Ryan Date: Thu, 8 May 2025 22:52:36 +0800 Subject: [PATCH 7/7] ci: Add unique artifact name for each run --- .github/workflows/phpunit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 944db6f..69d8c79 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -52,6 +52,6 @@ jobs: - name: Archive code coverage results uses: actions/upload-artifact@v4 with: - name: code-coverage-report + name: code-coverage-report-${{ matrix.php-versions }}-${{ matrix.phpunit-versions }}-${{ matrix.operating-system }} path: coverage/ retention-days: 90