From 949e5a94dfef0d7dbbc4a9d2f0972c451dc68fa9 Mon Sep 17 00:00:00 2001 From: Brandur Date: Thu, 19 Dec 2024 21:54:10 -0700 Subject: [PATCH] Add `.tool-versions` containing Ruby 3.3 Add a `.tool-versions` so that the project works out of the box with version managers like asdf and mise. Add a CI check that makes sure our Ruby version in use there matches what's in `.tool-versions` so the two don't drift. --- .github/workflows/ci.yaml | 10 ++++++++++ .tool-versions | 1 + 2 files changed, 11 insertions(+) create mode 100644 .tool-versions diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 61f712d..a393609 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -84,6 +84,16 @@ jobs: run: bundle exec standardrb working-directory: ./driver/riverqueue-sequel + tool_versions_check: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Check RUBY_VERSION matches .tool-versions Ruby version + run: [[ "$RUBY_VERSION" == "$(cat .tool-versions | grep ruby | cut -w -f 2)" ]] || echo "CI version \$RUBY_VERSION should match .tool-versions Ruby `cat .tool-versions | grep ruby | cut -w -f 2`" && (exit 1) + type_check: runs-on: ubuntu-latest timeout-minutes: 3 diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..053cba7 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby 3.3