Skip to content

Commit

Permalink
Configure a minimal CI
Browse files Browse the repository at this point in the history
  • Loading branch information
julik committed Mar 28, 2024
1 parent 153c9e3 commit b4143f1
Showing 1 changed file with 8 additions and 75 deletions.
83 changes: 8 additions & 75 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,93 +2,26 @@ name: CI

on:
- push
- pull_request

env:
BUNDLE_PATH: vendor/bundle

jobs:
lint:
name: Code Style
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
ruby:
- '2.7'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Gemfile Cache
uses: actions/cache@v2
with:
path: Gemfile.lock
key: ${{ runner.os }}-gemlock-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'zip_tricks.gemspec') }}
restore-keys: |
${{ runner.os }}-gemlock-${{ matrix.ruby }}-
- name: Bundle Cache
id: cache-gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'Gemfile.lock', 'zip_tricks.gemspec') }}
restore-keys: |
${{ runner.os }}-gems-${{ matrix.ruby }}-
${{ runner.os }}-gems-
- name: Bundle Install
if: steps.cache-gems.outputs.cache-hit != 'true'
run: bundle install --jobs 4 --retry 3
- name: Rubocop Cache
uses: actions/cache@v2
with:
path: ~/.cache/rubocop_cache
key: ${{ runner.os }}-rubocop-${{ hashFiles('.rubocop.yml') }}
restore-keys: |
${{ runner.os }}-rubocop-
- name: Rubocop
run: bundle exec rubocop
test:
name: Specs
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
name: Tests and Lint
runs-on: ubuntu-22.04
strategy:
matrix:
ruby:
- '3.0'
- '2.7'
- '2.1'
- 'jruby-9.2'
experimental: [false]
- '2.6'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Gemfile Cache
uses: actions/cache@v2
with:
path: Gemfile.lock
key: ${{ runner.os }}-gemlock-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'zip_tricks.gemspec') }}
restore-keys: |
${{ runner.os }}-gemlock-${{ matrix.ruby }}-
- name: Bundle Cache
id: cache-gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'Gemfile.lock', 'zip_tricks.gemspec') }}
restore-keys: |
${{ runner.os }}-gems-${{ matrix.ruby }}-
${{ runner.os }}-gems-
- name: Bundle Install
if: steps.cache-gems.outputs.cache-hit != 'true'
run: bundle install --jobs 4 --retry 3
- name: RSpec
continue-on-error: ${{ matrix.experimental }}
run: bundle exec rspec
bundler-cache: true
- name: "Tests"
run: bundle exec rspec --backtrace --fail-fast

0 comments on commit b4143f1

Please sign in to comment.