Skip to content

Commit

Permalink
Merge pull request #11 from mudge/restore-3.0-support
Browse files Browse the repository at this point in the history
Restore support for Ruby 3.0
  • Loading branch information
mudge authored Dec 28, 2024
2 parents 7cd8956 + a2c75eb commit d005d63
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 25 deletions.
140 changes: 119 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,36 @@ jobs:
with:
platform: x64-mingw-ucrt

precompile-x64-mingw32:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x64-mingw32

precompile-x86-mingw32:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x86-mingw32

test-ubuntu:
needs: "build-cruby-gem"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1", "truffleruby"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1", "truffleruby"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4.0-rc1", rubygems: "default" }
- { ruby: "truffleruby", rubygems: "default" }
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
Expand All @@ -126,13 +144,20 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4.0-rc1", rubygems: "default" }
runs-on: "macos-13"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
Expand All @@ -142,6 +167,25 @@ jobs:
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle

test-windows-2019:
needs: "build-cruby-gem"
runs-on: "windows-2019"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
rubygems: "3.5.23"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- run: ./scripts/test-gem-install
shell: bash
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle

test-windows-2022:
needs: "build-cruby-gem"
strategy:
Expand Down Expand Up @@ -190,7 +234,9 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4-rc"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -204,14 +250,16 @@ jobs:
docker run --rm -v "$(pwd):/argon2id" -w /argon2id \
--platform=linux/arm64 \
ruby:${{ matrix.ruby }} \
./scripts/test-gem-install
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-aarch64-linux-musl:
needs: "precompile-aarch64-linux-musl"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4-rc"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -225,14 +273,16 @@ jobs:
docker run --rm -v "$(pwd):/argon2id" -w /argon2id \
--platform=linux/arm64 \
ruby:${{ matrix.ruby }}-alpine \
./scripts/test-gem-install
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-arm-linux-gnu:
needs: "precompile-arm-linux-gnu"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4-rc"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -246,14 +296,16 @@ jobs:
docker run --rm -v "$(pwd):/argon2id" -w /argon2id \
--platform=linux/arm/v7 \
ruby:${{ matrix.ruby }} \
./scripts/test-gem-install
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-arm-linux-musl:
needs: "precompile-arm-linux-musl"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4-rc"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -267,14 +319,16 @@ jobs:
docker run --rm -v "$(pwd):/argon2id" -w /argon2id \
--platform=linux/arm/v7 \
ruby:${{ matrix.ruby }}-alpine \
./scripts/test-gem-install
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-x86-linux-gnu:
needs: "precompile-x86-linux-gnu"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4-rc"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -288,14 +342,16 @@ jobs:
docker run --rm -v "$(pwd):/argon2id" -w /argon2id \
--platform=linux/386 \
ruby:${{ matrix.ruby }} \
./scripts/test-gem-install
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-x86-linux-musl:
needs: "precompile-x86-linux-musl"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4-rc"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -309,20 +365,27 @@ jobs:
docker run --rm -v "$(pwd):/argon2id" -w /argon2id \
--platform=linux/386 \
ruby:${{ matrix.ruby }}-alpine \
./scripts/test-gem-install
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-x86_64-linux-gnu:
needs: "precompile-x86_64-linux-gnu"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4.0-rc1", rubygems: "default" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
Expand All @@ -337,7 +400,9 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4-rc"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
runs-on: ubuntu-latest
container:
image: "ruby:${{ matrix.ruby }}-alpine"
Expand All @@ -347,20 +412,27 @@ jobs:
with:
name: cruby-x86_64-linux-musl-gem
path: pkg
- run: ./scripts/test-gem-install
- run: ./scripts/test-gem-install ${{ matrix.rubygems }}

test-precompiled-arm64-darwin:
needs: "precompile-arm64-darwin"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4.0-rc1", rubygems: "default" }
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
Expand All @@ -375,13 +447,20 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"]
include:
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4.0-rc1", rubygems: "default" }
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -430,6 +509,25 @@ jobs:
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle

test-precompiled-x64-mingw32:
needs: "precompile-x64-mingw32"
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
rubygems: "3.5.23"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-x64-mingw32-gem
path: pkg
- run: ./scripts/test-gem-install
shell: bash
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle

ruby-memcheck:
runs-on: "ubuntu-latest"
env:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ User.find_by(name: "alice")&.authenticate("password") #=> user

This gem requires any of the following to run:

* [Ruby](https://www.ruby-lang.org/en/) 3.1 to 3.4.0-rc1
* [Ruby](https://www.ruby-lang.org/en/) 3.0 to 3.4.0-rc1
* [JRuby](https://www.jruby.org) 9.4
* [TruffleRuby](https://www.graalvm.org/ruby/) 24.1

Expand All @@ -274,7 +274,7 @@ Where possible, a pre-compiled native gem will be provided for the following pla
* `aarch64-linux`, `arm-linux`, `x86-linux`, `x86_64-linux` (requires [glibc](https://www.gnu.org/software/libc/) 2.29+, RubyGems 3.3.22+ and Bundler 2.3.21+)
* [musl](https://musl.libc.org/)-based systems such as [Alpine](https://alpinelinux.org) are supported with Bundler 2.5.6+
* macOS `x86_64-darwin` and `arm64-darwin`
* Windows `x64-mingw-ucrt`
* Windows `x64-mingw32` and `x64-mingw-ucrt`
* Java: any platform running JRuby 9.4 or higher

### Verifying the gems
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cross_platforms = %w[
x86_64-linux-musl
].freeze

ENV["RUBY_CC_VERSION"] = %w[3.4.0 3.3.5 3.2.0 3.1.0].join(":")
ENV["RUBY_CC_VERSION"] = %w[3.4.0 3.3.5 3.2.0 3.1.0 3.0.0].join(":")

gemspec = Gem::Specification.load("argon2id.gemspec")

Expand Down
2 changes: 1 addition & 1 deletion argon2id.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
"source_code_uri" => "https://github.com/mudge/argon2id",
"rubygems_mfa_required" => "true"
}
s.required_ruby_version = ">= 3.1.0"
s.required_ruby_version = ">= 3.0.0"
s.extensions = ["ext/argon2id/extconf.rb"]
s.files = [
"CHANGELOG.md",
Expand Down
7 changes: 7 additions & 0 deletions scripts/test-gem-install
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

set -eu

rubygems=${1:-}

if [ -n "$rubygems" ]
then
gem update --system "$rubygems"
fi

gem install --no-document pkg/*.gem
cd "$(dirname "$(gem which argon2id)")/.."
bundle
Expand Down

0 comments on commit d005d63

Please sign in to comment.