-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to build and profile third-party repo (#8398)
Merge pull request 8398
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |