From adf979ef1dbdd90fdd6dedd7a4cc71a738f02a62 Mon Sep 17 00:00:00 2001 From: Weston Ganger Date: Tue, 20 Aug 2024 14:59:35 -0700 Subject: [PATCH] Fix CI env variables --- .github/workflows/test.yml | 25 +++++++++++++------------ Gemfile | 4 +++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e43488..370a586 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,32 +20,33 @@ 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" - ruby: "2.6" - env: - RAILS_VERSION: "6.0" + rails_version: "~> 6.0" - ruby: "2.6" - env: - RAILS_VERSION: "6.1" + rails_version: "~> 6.1" - ruby: "3.3" - env: - RAILS_VERSION: "7.0" + rails_version: "~> 7.0" - ruby: "3.3" - env: - RAILS_VERSION: "7.1" + rails_version: "~> 7.1" - ruby: "3.3" - env: - RAILS_VERSION: "7.2" + rails_version: "~> 7.2" 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 e82190b..3dfa7f9 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,9 @@ def get_env(name) end gem "rails", get_env("RAILS_VERSION") -gem "sqlite3" + +db_gem = get_env("DB_GEM") || "sqlite3" +gem db_gem, get_env("DB_GEM_VERSION") group :development, :test do gem "sprockets-rails" ### just for dummy app