From 7efaa4bd358f2173a3a1e191358de7d6765f3a72 Mon Sep 17 00:00:00 2001 From: Weston Ganger Date: Tue, 20 Aug 2024 13:49:07 -0700 Subject: [PATCH] Fix CI env variables --- .github/workflows/test.yml | 49 +++++++++++++++----------------------- Gemfile | 2 +- 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7fd24ff..f37dd71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,62 +20,49 @@ 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: "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" ### STORAGE METHOD TESTING - ruby: 3.3 db_gem: "sqlite3" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "serialized_json" + active_snapshot_storage_method: "serialized_json" - ruby: 3.3 db_gem: "sqlite3" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "serialized_yaml" + active_snapshot_storage_method: "serialized_yaml" - ruby: 3.3 db_gem: "sqlite3" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "native_json" + active_snapshot_storage_method: "native_json" - ruby: 3.3 db_gem: "mysql2" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "serialized_json" + active_snapshot_storage_method: "serialized_json" - ruby: 3.3 db_gem: "mysql2" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "serialized_yaml" + active_snapshot_storage_method: "serialized_yaml" - ruby: 3.3 db_gem: "mysql2" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "native_json" + active_snapshot_storage_method: "native_json" - ruby: 3.3 db_gem: "pg" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "serialized_json" + active_snapshot_storage_method: "serialized_json" - ruby: 3.3 db_gem: "pg" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "serialized_yaml" + active_snapshot_storage_method: "serialized_yaml" - ruby: 3.3 db_gem: "pg" - env: - ACTIVE_SNAPSHOT_STORAGE_METHOD: "native_json" + active_snapshot_storage_method: "native_json" services: mysql: @@ -104,10 +91,12 @@ jobs: echo "DATABASE_URL=postgres://postgres:password@localhost:5432/test" >> "$GITHUB_ENV" fi - - name: Set env DB_GEM - if: ${{ matrix.db_gem }} + - 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" + echo "ACTIVE_SNAPSHOT_STORAGE_METHOD=${{ matrix.active_snapshot_storage_method }}" >> "$GITHUB_ENV" - name: Install ruby uses: ruby/setup-ruby@v1 diff --git a/Gemfile b/Gemfile index 740abbb..9f879d5 100644 --- a/Gemfile +++ b/Gemfile @@ -9,4 +9,4 @@ end gem 'rails', get_env("RAILS_VERSION") db_gem = get_env("DB_GEM") || "sqlite3" -gem db_gem +gem db_gem, get_env("DB_GEM_VERSION")