Skip to content

Commit

Permalink
Merge pull request #11 from jclusso/add_gh_workflow
Browse files Browse the repository at this point in the history
Add GH workflow and fix failing items
  • Loading branch information
jaredcwhite authored Mar 17, 2024
2 parents bc1fb05 + b511229 commit 7fb5eb4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Tests

on:
pull_request:
branches:
- "*"
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby_version: [2.7.7, 3.0.5, 3.1.3, 3.2.0, 3.3.0]
bridgetown_version: [1.2.0]
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
# Has to be top level to cache properly
env:
BUNDLE_JOBS: 3
BUNDLE_PATH: "vendor/bundle"
BRIDGETOWN_VERSION: ${{ matrix.bridgetown_version }}
steps:
- uses: actions/checkout@master
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Test with Rake
run: script/cibuild
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ source "https://rubygems.org"
gemspec

gem "bridgetown", ENV["BRIDGETOWN_VERSION"] if ENV["BRIDGETOWN_VERSION"]
gem "bundler", ">= 1.15"
gem "html-proofer", "~> 3.7"
gem "rake", "~> 13.0"
gem "rspec", "~> 3.5"
gem "rubocop-bridgetown", "~> 0.3"
6 changes: 0 additions & 6 deletions bridgetown-seo-tag.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,5 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "bridgetown", ">= 1.2.0.beta5", "< 2.0"

spec.add_development_dependency "bundler", ">= 1.15"
spec.add_development_dependency "html-proofer", "~> 3.7"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.5"
spec.add_development_dependency "rubocop-bridgetown", "~> 0.3"
spec.metadata["rubygems_mfa_required"] = "true"
end
2 changes: 1 addition & 1 deletion lib/bridgetown-seo-tag/url_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module UrlHelper
# Retruns false if it's a relative URL
# Returns nil if it is not a string or can't be parsed as a URL
def absolute_url?(string)
return unless string
return false unless string

Addressable::URI.parse(string).absolute?
rescue Addressable::URI::InvalidURIError
Expand Down
2 changes: 2 additions & 0 deletions spec/bridgetown_seo_tag_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@

it "minifies the output" do
version = Bridgetown::SeoTag::VERSION
# rubocop:disable Bridgetown/HTMLEscapedHeredoc
expected = <<~HTML
<!-- Begin Bridgetown SEO tag v#{version} -->
<title>Foo</title>
Expand All @@ -299,6 +300,7 @@
<meta property="og:url" content="http://example.invalid/page/" />
<meta property="og:site_name" content="Foo" />
HTML
# rubocop:enable Bridgetown/HTMLEscapedHeredoc
expect(output).to match(expected)
end
end
Expand Down

0 comments on commit 7fb5eb4

Please sign in to comment.