From 47ddfa206ae9562b8a8c0c8718a2ebf33d52b676 Mon Sep 17 00:00:00 2001 From: Anton Maminov Date: Fri, 5 Apr 2024 13:54:51 +0300 Subject: [PATCH] windows ci --- .github/workflows/crystal.yml | 10 +++++++++- src/ipapi.cr | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/crystal.yml b/.github/workflows/crystal.yml index 23f382d..4c06b3f 100644 --- a/.github/workflows/crystal.yml +++ b/.github/workflows/crystal.yml @@ -18,10 +18,18 @@ jobs: run: crystal tool format --check test: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - { os: ubuntu-latest } + - { os: windows-latest } + runs-on: ${{ matrix.os }} steps: - name: Install Crystal uses: crystal-lang/install-crystal@v1 + with: + crystal: ${{ matrix.crystal }} - name: Check out repository code uses: actions/checkout@v4 - name: Install dependencies diff --git a/src/ipapi.cr b/src/ipapi.cr index 3d800da..3422c86 100644 --- a/src/ipapi.cr +++ b/src/ipapi.cr @@ -38,7 +38,7 @@ module Ipapi # Retrive the location of a specific IP address. # If `ip_address` is `nil`, use the client's IP. def locate(ip_address : String? = nil) : Location? - url = Path.new([API_URL, ip_address, "json"].compact).to_s + url = Path.posix([API_URL, ip_address, "json"].compact).to_s url = url + "?key=#{@api_key}" if @api_key response = HTTP::Client.get(url) @@ -50,7 +50,7 @@ module Ipapi # Retrive {{description.id}} of a specific IP address. # If `ip_address` is `nil`, use the client's IP. def {{field.id}}(ip_address : String? = nil) : String - url = Path.new([API_URL, ip_address, "{{field.id}}"].compact).to_s + url = Path.posix([API_URL, ip_address, "{{field.id}}"].compact).to_s url = url + "?key=#{@api_key}" if @api_key