Skip to content

Commit

Permalink
Add workflow to build and profile third-party repo (#8398)
Browse files Browse the repository at this point in the history
Merge pull request 8398
  • Loading branch information
ashmaroli committed Sep 17, 2020
1 parent 94930c5 commit c066999
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/actions/memprof.rb
@@ -0,0 +1,14 @@
# frozen_string_literal: true

require 'jekyll'
require 'memory_profiler'

MemoryProfiler.report(allow_files: 'lib/jekyll/') 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)
48 changes: 48 additions & 0 deletions .github/workflows/third-party.yml
@@ -0,0 +1,48 @@
name: Third-Party Repository Profiling

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_n_profile:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout Jekyll
uses: actions/checkout@v2
with:
fetch-depth: 5
path: jekyll
- name: Checkout Third-Party Repository
uses: actions/checkout@v2
with:
repository: ashmaroli/tomjoht.github.io
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 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
run: bundle exec ruby jekyll/.github/workflows/actions/memprof.rb sandbox

0 comments on commit c066999

Please sign in to comment.