name: Ruby Gem on: push: branches: [ master, dev ] paths-ignore: - "**/README.md" pull_request: branches: [ master, dev ] paths-ignore: - "**/README.md" jobs: tests: name: Tests runs-on: ubuntu-latest strategy: matrix: ruby: [2.5, 2.6, 2.7, 3.0] rails: ['5.0', '5.1', '5.2', '6.0', '6.1'] steps: - uses: actions/checkout@v2 - name: always-upload-cache # You may pin to the exact commit or the version. # uses: pat-s/always-upload-cache@8bf65902d2f73eea094eb913323ef6fb84f4bcb8 uses: pat-s/always-upload-cache@v2.1.3 with: # A list of files, directories, and wildcard patterns to cache and restore path: $(pwd)/vendor/bundle key: ${{ runner.os }}-gems-${{ hashFiles('test/gemfiles/*.gemfile') }} restore-keys: | ${{ runner.os }}-gems- - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Bundle install run: | bundle config path $(pwd)/vendor/bundle bundle install --jobs 4 --retry 3 env: BUNDLE_GEMFILE: "test/gemfiles/${{ matrix.rails }}.gemfile" - run: bundle exec rake