From 0ebb965e32db645b0901497593bd0d1fffd32d10 Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Sat, 19 Dec 2020 14:21:04 +0200 Subject: [PATCH 1/2] Adds GitHub Actions for unlimited CI and faster feedback --- .github/workflows/test.yml | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..d2fae664 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,72 @@ +name: Test + +on: + push: + branches: [ $default-branch ] + pull_request: + +env: + NOKOGIRI_USE_SYSTEM_LIBRARIES: true + SPEC_OPTS: '--backtrace' + +jobs: + test: + name: Functional Testing + runs-on: ubuntu-20.04 # In order to install libvips 8.9+ version + + strategy: + matrix: + ruby-version: + - 2.1 + - 2.2 + - 2.3 + - 2.4 + - 2.5 + - 2.6 + - 2.7 + - jruby + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + + - name: Updates apt + env: + DEBIAN_FRONTEND: noninteractive + run: sudo apt-get update -qq -o Acquire::Retries=3 + + - name: Install libvips + env: + DEBIAN_FRONTEND: noninteractive + run: + sudo apt install --fix-missing -qq --no-install-recommends -o Acquire::Retries=3 + libvips libvips-dev libvips-tools + gettext + libcfitsio-dev + libexpat1-dev + libfftw3-dev + libgif-dev + libglib2.0-dev + libgsf-1-dev + libjpeg-turbo8-dev + liblcms2-dev + libmagickwand-dev + libmatio-dev + libopenexr-dev + libopenslide-dev + liborc-0.4-dev + libpango1.0-dev + libpoppler-glib-dev + libtiff5-dev + libwebp-dev + librsvg2-dev + libmagick++-dev + + - name: Run Tests + run: bundle exec rake spec From 576a7e282c0275ba9f4af33825b20b7a3088ae02 Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Sat, 19 Dec 2020 17:00:59 +0200 Subject: [PATCH 2/2] Adds standard gem to make code consistent --- .github/workflows/test.yml | 17 +++++++++++++++++ .standard.yml | 8 ++++++++ Gemfile | 1 + TODO | 6 +----- 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .standard.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2fae664..6fe8dd9e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,23 @@ env: SPEC_OPTS: '--backtrace' jobs: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + + - name: Run Standard Ruby linter + run: bin/standardrb --no-fix --fail-fast + continue-on-error: true + test: name: Functional Testing runs-on: ubuntu-20.04 # In order to install libvips 8.9+ version diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 00000000..4bf8af6a --- /dev/null +++ b/.standard.yml @@ -0,0 +1,8 @@ +fix: false # default: false +parallel: true # default: false +format: progress # default: Standard::Formatter +ruby_version: 2.5 # default: RUBY_VERSION +default_ignores: false # default: true + +ignore: # default: [] + - 'vendor/**/*' diff --git a/Gemfile b/Gemfile index 2b0190b4..971b2d89 100644 --- a/Gemfile +++ b/Gemfile @@ -5,3 +5,4 @@ gemspec gem 'github-markup' gem 'redcarpet', platforms: :ruby +gem 'standard', platforms: :ruby diff --git a/TODO b/TODO index 901d6494..a89764fe 100644 --- a/TODO +++ b/TODO @@ -9,7 +9,7 @@ - Lint. - bundle exec rake rubocop + bundle exec standardrb - Reinstall local copy of gem after a change. @@ -31,10 +31,6 @@ require 'vips'; Vips::Yard.generate ^D -- Regenerate `.rubocop_todo.yml`. - - bundle exec rubocop --auto-gen-config - - Regenerate docs. bundle exec rake yard