瀏覽代碼

Refactor Github actions CI to correctly load gemfile (#817)

* Correctly load gemfile config

Co-authored-by: Andy Waite <andyw8@users.noreply.github.com>
Kevin McPhillips 3 年之前
父節點
當前提交
0e434d27bc
共有 1 個文件被更改,包括 19 次插入11 次删除
  1. 19 11
      .github/workflows/build.yml

+ 19 - 11
.github/workflows/build.yml

@@ -1,30 +1,38 @@
 name: CI
 
-on: 
-  push:
+on:
+  - push
 
 jobs:
   build:
+    name: Ruby ${{ matrix.version }} ${{ matrix.gemfile }}
     runs-on: ubuntu-latest
-    name: Ruby ${{ matrix.version }}, ${{ matrix.gemfile }}
+    env:
+      BUNDLE_GEMFILE: ${{ matrix.gemfile }}
     strategy:
       matrix:
-        version: [2.4, 2.5, 2.6, 2.7]
-        gemfile: [Gemfile_ar41, Gemfile_ar50, Gemfile_ar51, Gemfile_ar_master]
+        version:
+          - 2.4
+          - 2.5
+          - 2.6
+          - 2.7
+        gemfile:
+          - Gemfile_ar41
+          - Gemfile_ar50
+          - Gemfile_ar51
+          - Gemfile_ar_master
         exclude:
           - version: 2.7
             gemfile: Gemfile_ar41
-
     steps:
       - uses: actions/checkout@v2
+      - name: Remove Gemfile.lock
+        run: |
+          rm -f ${GITHUB_WORKSPACE}/Gemfile.lock
       - name: Set up Ruby ${{ matrix.version }}
         uses: ruby/setup-ruby@v1
-        with: 
+        with:
           ruby-version: ${{ matrix.version }}
-      - name: Set up gemfile
-        run: |
-          export BUNDLE_GEMFILE=${GITHUB_WORKSPACE}/${{ matrix.gemfile }}
-          rm -f ${GITHUB_WORKSPACE}/Gemfile.lock
       - name: Run Tests
         run: |
           bundle config set --with docs