From 2a1806c8ca6dafa0bcf7dd3ed0f8531d20879384 Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 27 Apr 2020 23:32:57 -0400 Subject: [PATCH] Cache dependencies in CI (#26) --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec3a7e1..cea83c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,18 +12,27 @@ jobs: steps: - uses: actions/checkout@master - - name: Sets up the Ruby version + - name: Set up the Ruby version uses: actions/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - name: Sets up the environment + - name: Ruby gem cache + uses: actions/cache@v1 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + + - name: Set up the environment run: | gem install bundler + bundle config path vendor/bundle bundle install --jobs 4 --retry 3 - name: Runs tests - run: rspec + run: bundle exec rspec rubocop: runs-on: ubuntu-latest @@ -34,15 +43,24 @@ jobs: steps: - uses: actions/checkout@master - - name: Sets up the Ruby version + - name: Set up the Ruby version uses: actions/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - name: Sets up the environment + - name: Ruby gem cache + uses: actions/cache@v1 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + + - name: Set up the environment run: | gem install bundler + bundle config path vendor/bundle bundle install --jobs 4 --retry 3 - name: Runs Rubocop - run: rubocop + run: bundle exec rubocop