Skip to content

Commit

Permalink
Fix CI on 4.2-stable branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Aug 29, 2021
1 parent 871a05a commit ba024ea
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 49 deletions.
36 changes: 9 additions & 27 deletions .github/workflows/ci.yml
Expand Up @@ -3,27 +3,25 @@ name: Continuous Integration
on:
push:
branches:
- master
- /.*-stable/
- 4.2-stable
pull_request:
branches:
- master
- /.*-stable/
- 4.2-stable

jobs:
ci:
if: "!contains(github.event.commits[0].message, '[ci skip]')"
name: 'Ruby ${{ matrix.ruby_version }}'
runs-on: 'ubuntu-latest'

env:
CI: true
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.5
- 2.7
- jruby-9.2.11.1

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -35,12 +33,8 @@ jobs:
bundler-cache: true
- name: Run Unit Tests
run: bash script/test
env:
CI: true
- name: Run Cucumber Features
run: bash script/cucumber
env:
CI: true
- name: Sanity Check
run: bash script/default-site

Expand Down Expand Up @@ -69,34 +63,22 @@ jobs:
if: "!contains(github.event.commits[0].message, '[ci skip]')"
name: 'Profile Docs Site (Ruby ${{ matrix.ruby_version }})'
runs-on: 'ubuntu-latest'
env:
CI: true
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.4 # Minimum required Ruby version in gemspec
- 2.5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- name: "Set up Ruby ${{ matrix.ruby_version }}"
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Cache dependencies
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: 'Update Rubygems and Bundler'
run: |
gem update --system --no-document
gem update bundler --no-document
- name: Set up bundle
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundler-cache: true
- name: Build Docs site with --profile
run: bash script/profile-docs
- name: Profile memory usage of building Docs site
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/third-party.yml
Expand Up @@ -3,14 +3,20 @@ name: Third-Party Repository Profiling
on:
push:
branches:
- master
- 4.2-stable
pull_request:
branches:
- master
- 4.2-stable
jobs:
build_n_profile:
if: "!contains(github.event.commits[0].message, '[ci skip]')"
runs-on: 'ubuntu-latest'
env:
BUNDLE_GEMFILE: "sandbox/Gemfile"
BUNDLE_PATH: "vendor/bundle"
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
CI: true
steps:
- name: Checkout Jekyll
uses: actions/checkout@v2
Expand All @@ -23,23 +29,10 @@ jobs:
repository: ashmaroli/tomjoht.github.io
path: sandbox
- name: Set up Ruby
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Set up Dependencies Cache
uses: actions/cache@v1
with:
path: sandbox/vendor/bundle
key: ubuntu-latest-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
ubuntu-latest-gems-
- name: Set up Dependencies
run: |
gem update --system --no-document
gem update bundler --no-document
bundle config gemfile sandbox/Gemfile
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundler-cache: true
- name: Run Jekyll Build 3 times
run: |
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Expand Up @@ -10,6 +10,7 @@ Jekyll/NoPutsAllowed:
- rake/*.rake

AllCops:
SuggestExtensions: false
TargetRubyVersion: 2.4
Include:
- lib/**/*.rb
Expand Down Expand Up @@ -303,6 +304,8 @@ Style/RedundantArgument:
Enabled: true
Style/RedundantAssignment:
Enabled: true
Style/RedundantBegin:
Enabled: false
Style/RedundantFetchBlock:
Enabled: false
Style/RedundantFileExtensionInRequire:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -23,7 +23,7 @@ group :test do
gem "nokogiri", "~> 1.7"
gem "rspec"
gem "rspec-mocks"
gem "rubocop", "~> 1.0"
gem "rubocop", "~> 1.12.0"
gem "rubocop-performance"
gem "test-dependency-theme", :path => File.expand_path("test/fixtures/test-dependency-theme", __dir__)
gem "test-theme", :path => File.expand_path("test/fixtures/test-theme", __dir__)
Expand Down
6 changes: 3 additions & 3 deletions features/create_sites.feature
Expand Up @@ -184,17 +184,17 @@ Feature: Create sites
Given I have a _posts directory
And I have the following post:
| title | date | layout | content |
| entry1 | 2020-12-31 | post | content for entry1. |
| entry1 | 2040-12-31 | post | content for entry1. |
| entry2 | 2007-12-31 | post | content for entry2. |
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "content for entry2" in "_site/2007/12/31/entry2.html"
And the "_site/2020/12/31/entry1.html" file should not exist
And the "_site/2040/12/31/entry1.html" file should not exist
When I run jekyll build --future
Then I should get a zero exit status
And the _site directory should exist
And the "_site/2020/12/31/entry1.html" file should exist
And the "_site/2040/12/31/entry1.html" file should exist

Scenario: Basic site with layouts, posts and related posts
Given I have a _layouts directory
Expand Down
2 changes: 1 addition & 1 deletion features/post_excerpts.feature
Expand Up @@ -108,7 +108,7 @@ Feature: Post excerpts
Then I should get a zero exit status
And I should not see "Kramdown warning" in the build output
But I should see exactly "<p>Install Jekyll</p>" in "_site/just-text-excerpt.html"
And I should see "<p>Alpha <sup id=\"fnref:1\" role=\"doc-noteref\"><a href=\"#fn:1\" class=\"footnote\">1</a></sup></p>" in "_site/text-and-footnote.html"
And I should see "<p>Alpha <sup id=\"fnref:1\" role=\"doc-noteref\"><a href=\"#fn:1\" class=\"footnote\" rel=\"footnote\">1</a></sup></p>" in "_site/text-and-footnote.html"
And I should see "<p>Omega sigma <a href=\"#fnref:1\" class=\"reversefootnote\" role=\"doc-backlink\">&#8617;</a></p>" in "_site/text-and-footnote.html"
And I should see "<p>Read <a href=\"docs.jekyll.com\">docs</a></p>" in "_site/text-and-reference-link.html"
And I should see "<p>Check out <a href=\"jekyllrb.com\">jekyll</a></p>" in "_site/text-and-self-refencing-link.html"

0 comments on commit ba024ea

Please sign in to comment.