From 76bd822806c871949690ecfa30f5d9398457ae23 Mon Sep 17 00:00:00 2001 From: Weston Ganger Date: Tue, 20 Aug 2024 13:57:29 -0700 Subject: [PATCH] Fix CI env variables --- .github/workflows/test.yml | 26 ++++++++++++++------------ Gemfile | 6 ++++-- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6e5745..6027906 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,32 +20,34 @@ jobs: - ruby: "2.6" - ruby: "2.7" - ruby: "3.0" + db_gem_version: "~> 1.4" # fixes sqlite3 gem dependency issue - ruby: "3.1" - ruby: "3.2" - ruby: "3.3" ### TEST RAILS VERSIONS - ruby: "2.6" - env: - RAILS_VERSION: "5.2" + rails_version: "~> 5.2.0" - ruby: "2.6" - env: - RAILS_VERSION: "6.0" + rails_version: "~> 6.0.0" - ruby: "2.6" - env: - RAILS_VERSION: "6.1" + rails_version: "~> 6.1.0" - ruby: "3.3" - env: - RAILS_VERSION: "7.0" + rails_version: "~> 7.0.0" + db_gem_version: "~> 1.4" # fixes sqlite3 gem dependency issue - ruby: "3.3" - env: - rails_version: "7.1" + rails_version: "~> 7.1.0" - ruby: "3.3" - env: - RAILS_VERSION: "7.2" + rails_version: "~> 7.2.0" steps: - uses: actions/checkout@v3 + - name: Set env variables + run: | + echo "RAILS_VERSION=${{ matrix.rails_version }}" >> "$GITHUB_ENV" + echo "DB_GEM=${{ matrix.db_gem }}" >> "$GITHUB_ENV" + echo "DB_GEM_VERSION=${{ matrix.db_gem_version }}" >> "$GITHUB_ENV" + - name: Install ruby uses: ruby/setup-ruby@v1 with: diff --git a/Gemfile b/Gemfile index 08f763a..4f51ef8 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,8 @@ def get_env(name) end gem "rails", get_env("RAILS_VERSION") -gem "sqlite3" -gem "minitest-spec-rails", git: "https://github.com/metaskills/minitest-spec-rails.git" +db_gem = get_env("DB_GEM") || "sqlite3" +gem db_gem, get_env("DB_GEM_VERSION") + +gem "minitest-spec-rails"