From 885a4bd5d79133d2d3f976f85ad191f8e6b6e492 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Tue, 10 Mar 2026 09:57:37 +0900 Subject: [PATCH 1/4] CI: Migrate to GitHub Actions --- .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 10 --------- 2 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9e08884 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Test + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0'] + + name: Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + + - name: Replace libcurl.dll + if: runner.os == 'Windows' + run: | + # The `libcurl.dll` bundled with Ruby on Windows (MSYS2) has missing dependencies and cannot be loaded by `ethon` out of the box. (Ref: https://github.com/typhoeus/typhoeus/issues/720) + choco install curl --no-progress + + $curlTools = "C:\ProgramData\chocolatey\lib\curl\tools" + $srcDll = Get-ChildItem -Path $curlTools -Filter "libcurl*.dll" -Recurse | Select-Object -First 1 + + $rubyBin = Split-Path (Get-Command ruby.exe).Source + $destDll = Join-Path $rubyBin "libcurl.dll" + Copy-Item -Path $srcDll.FullName -Destination $destDll -Force + + - name: Run tests + run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3795477..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -sudo: false - -rvm: - - 2.5.0 - - 2.4.3 - - 2.3 - - 2.2 - -before_install: - - gem update bundler From c97016c35ab2641acb8056bbee3d868eefdd4ed0 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Tue, 10 Mar 2026 12:09:28 +0900 Subject: [PATCH 2/4] Remove workflow_dispatch Co-authored-by: Sutou Kouhei --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e08884..fd74879 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,6 @@ name: Test on: push: pull_request: - workflow_dispatch: permissions: contents: read From 5752824f9262038eeebb89ea8254de3114ae5aa8 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Tue, 10 Mar 2026 12:19:50 +0900 Subject: [PATCH 3/4] Use ruby_versions.yml --- .github/workflows/test.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fd74879..4cc643a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,21 +8,30 @@ permissions: contents: read jobs: + ruby-versions: + uses: ruby/actions/.github/workflows/ruby_versions.yml@master + with: + engine: cruby + min_version: 2.7 + test: + needs: ruby-versions + name: ${{ matrix.os }} ${{ matrix.ruby }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0'] - - name: Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Replace libcurl.dll From a014728d15d8f5eb0c26308aa3b3e26c7cbcc94e Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Tue, 10 Mar 2026 13:48:15 +0900 Subject: [PATCH 4/4] Remove Windows jobs and workaround --- .github/workflows/test.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4cc643a..dd249ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,6 @@ jobs: os: - ubuntu-latest - macos-latest - - windows-latest steps: - uses: actions/checkout@v6 - name: Set up Ruby @@ -34,18 +33,5 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Replace libcurl.dll - if: runner.os == 'Windows' - run: | - # The `libcurl.dll` bundled with Ruby on Windows (MSYS2) has missing dependencies and cannot be loaded by `ethon` out of the box. (Ref: https://github.com/typhoeus/typhoeus/issues/720) - choco install curl --no-progress - - $curlTools = "C:\ProgramData\chocolatey\lib\curl\tools" - $srcDll = Get-ChildItem -Path $curlTools -Filter "libcurl*.dll" -Recurse | Select-Object -First 1 - - $rubyBin = Split-Path (Get-Command ruby.exe).Source - $destDll = Join-Path $rubyBin "libcurl.dll" - Copy-Item -Path $srcDll.FullName -Destination $destDll -Force - - name: Run tests run: bundle exec rake