Skip to content

Commit

Permalink
Reorganize CI config
Browse files Browse the repository at this point in the history
Remove most of the cruft and make it pass
  • Loading branch information
julik committed Feb 29, 2024
1 parent dbdeefc commit 13a5bdf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 77 deletions.
83 changes: 10 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,28 @@ 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' # This has to be the oldest versions of Ruby + Rubocop we support, as Rubocop parser is bound to the Ruby version
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.3'
- '2.5'
experimental: [false]
- '2.6'
- '3.2'
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: Appraisal Install
if: steps.cache-gems.outputs.cache-hit != 'true'
run: bundle exec appraisal install
- name: "Appraisal RSpec"
continue-on-error: ${{ matrix.experimental }}
run: bundle exec appraisal spec
bundler-cache: true
- name: "Tests"
run: bundle exec rspec --backtrace --fail-fast
- name: "Lint"
run: bundle exec rake standard
5 changes: 4 additions & 1 deletion .standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ ruby_version: 2.7
ignore:
- 'spec/**/*':
- Lint/ConstantDefinitionInBlock
- Style/GlobalVars
- Style/GlobalVars
- 'lib/zip_kit/rack_body.rb': # Erroneous detection
- Lint/OrderedMagicComments
- Layout/EmptyLineAfterMagicComment
3 changes: 1 addition & 2 deletions lib/zip_kit/rack_body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
# end
# end
#
# either as a `Transfer-Encoding: chunked` response (if your webserver supports it),

# Either as a `Transfer-Encoding: chunked` response (if your webserver supports it),
# which will give you true streaming capability:
#
# chunked_body = iterable_zip_body.to_chunked
Expand Down
2 changes: 1 addition & 1 deletion zip_kit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "benchmark-ips"
spec.add_development_dependency "allocation_stats", "~> 0.1.5"
spec.add_development_dependency "yard", "~> 0.9"
spec.add_development_dependency "standard" # , ">= 0.2.5", "< 0.3" # Since we want to support Ruby 2.6 for the moment
spec.add_development_dependency "standard", "1.28.5" # Very specific version of standard for 2.6 with _known_ settings
spec.add_development_dependency "magic_frozen_string_literal"
spec.add_development_dependency "puma"
spec.add_development_dependency "appraisal", "~> 2.5"
Expand Down

0 comments on commit 13a5bdf

Please sign in to comment.