Преглед изворни кода

Merge pull request #1403 from onevcat/fix/action-install-cache

Prevent bundle run when cache hit
Wei Wang пре 5 година
родитељ
комит
6d80748af5
1 измењених фајлова са 5 додато и 3 уклоњено
  1. 5 3
      .github/workflows/build.yaml

+ 5 - 3
.github/workflows/build.yaml

@@ -12,15 +12,17 @@ jobs:
     steps:
     steps:
       - uses: actions/checkout@v1
       - uses: actions/checkout@v1
       - uses: actions/cache@v1
       - uses: actions/cache@v1
+        id: bundler-cache
         with:
         with:
           path: vendor/bundle
           path: vendor/bundle
           key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
           key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
           restore-keys: |
           restore-keys: |
             ${{ runner.os }}-gems-
             ${{ runner.os }}-gems-
+      - name: Bundle setup
+        run: bundle config path vendor/bundle
       - name: Bundle install
       - name: Bundle install
-        run: |
-          bundle config path vendor/bundle
-          bundle install --jobs 4 --retry 3
+        if: steps.bundler-cache.outputs.cache-hit != 'true'
+        run: bundle install --jobs 4 --retry 3
       - name: Run tests
       - name: Run tests
         env:
         env:
           DESTINATION: platform=${{ matrix.destination }}
           DESTINATION: platform=${{ matrix.destination }}