Profile plugin using a third-party repo (#414)

Merge pull request 414
This commit is contained in:
Ashwin Maroli 2020-09-30 15:07:34 +05:30 committed by GitHub
parent ae6ce57b36
commit c00f3dbc26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 75 additions and 0 deletions

14
.github/workflows/actions/memprof.rb vendored Normal file
View File

@ -0,0 +1,14 @@
# frozen_string_literal: true
require 'jekyll'
require 'memory_profiler'
MemoryProfiler.report(allow_files: 'lib/jekyll-seo-tag') do
Jekyll::PluginManager.require_from_bundler
Jekyll::Commands::Build.process({
"source" => File.expand_path(ARGV[0]),
"destination" => File.expand_path("#{ARGV[0]}/_site"),
"disable_disk_cache" => true,
})
puts ''
end.pretty_print(scale_bytes: true, normalize_paths: true)

61
.github/workflows/third-party.yml vendored Normal file
View File

@ -0,0 +1,61 @@
name: Third-Party Repository Profiling
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_n_profile:
if: "!contains(github.event.commits[0].message, '[ci skip]')"
runs-on: 'ubuntu-latest'
steps:
- name: Checkout Jekyll SEO Tag
uses: actions/checkout@v2
with:
fetch-depth: 5
path: jekyll-seo-tag
- name: Checkout Third-Party Repository (WITHOUT SEO Tag)
uses: actions/checkout@v2
with:
repository: ashmaroli/tomjoht.github.io
ref: 'no-seo-tag'
path: alpha-sandbox
- name: Checkout Same Third-Party Repository (WITH SEO Tag)
uses: actions/checkout@v2
with:
repository: ashmaroli/tomjoht.github.io
ref: 'seo-tag'
path: sandbox
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Set up Dependencies Cache
uses: actions/cache@v1
with:
path: sandbox/vendor/bundle
key: ubuntu-latest-gems-
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
- name: Run Jekyll Build (WITHOUT SEO Tag) 3 times
run: |
bundle exec jekyll build -s alpha-sandbox -d alpha-sandbox/_site --trace
bundle exec jekyll build -s alpha-sandbox -d alpha-sandbox/_site --trace
bundle exec jekyll build -s alpha-sandbox -d alpha-sandbox/_site --trace
- name: Run Jekyll Build (WITH SEO Tag) 3 times
run: |
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
- name: Memory Analysis of Jekyll Build (WITH SEO Tag)
run: bundle exec ruby jekyll-seo-tag/.github/workflows/actions/memprof.rb sandbox