trilogy-libraries / trilogy

Trilogy is a client library for MySQL-compatible database servers, designed for performance, flexibility, and ease of embedding.
MIT License
700 stars 69 forks source link

CI for old Rubies doesn't work correctly #137

Closed y-yagi closed 9 months ago

y-yagi commented 11 months ago

Currently, it looks like trilogy tries to run against two old Ruby versions, 1.9 and 2.8.

https://github.com/trilogy-libraries/trilogy/blob/e577853a1f40a681cd7fc91c3c4e97e69e31762c/.github/workflows/ci.yml#L24 https://github.com/trilogy-libraries/trilogy/blob/e577853a1f40a681cd7fc91c3c4e97e69e31762c/.github/workflows/ci.yml#L27

But, this is strange because Ruby 2.8 doesn't exist, the last version of 2.x series is 2.7. It seems that the build for 1.9 and 2.8 uses Ruby 3.2.

Build (5.7, debian:buster, 1.9)

I think this is because FROM is set after ARG RUBY_VERSION. https://github.com/trilogy-libraries/trilogy/blob/e577853a1f40a681cd7fc91c3c4e97e69e31762c/Dockerfile#L2-L3

FROM creates a new scope and you need to define ARG after FROM if you want to use it inside the scope. https://docs.docker.com/engine/reference/builder/#scope

So the current Dockerfile ignores RUBY_VERSION arg and always use Ruby 3.2.

I'm not sure trilogy's support policy for old Ruby versions. So I submitted an issue for just for your information.