Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to build and profile third-party repo #8398

Merged
merged 1 commit into from Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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