Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
67 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,36 @@ | ||
name: Benchmark | ||
|
||
on: | ||
push: | ||
branchs: [ master ] | ||
pull_request: | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node-version: ['10.x', '12.x', '14.x'] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache NPM dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.OS }}-npm-cache | ||
restore-keys: | | ||
${{ runner.OS }}-npm-cache | ||
- name: Running benchmark | ||
run: | | ||
echo "============== Hexo Benchmark ==============" > benchmark-result-${{ matrix.node-version }}.txt | ||
node test/benchmark.js >> benchmark-result-${{ runner.OS }}-${{ matrix.node-version }}.txt | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: benchmark-results | ||
path: benchmark-result-${{ runner.OS }}-${{ matrix.node-version }}.txt |
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
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,53 @@ | ||
name: profiling | ||
|
||
on: | ||
push: | ||
branchs: [ master ] | ||
pull_request: | ||
|
||
jobs: | ||
profiling: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: ['10.x', '12.x', '14.x'] | ||
fail-fast: false | ||
steps: | ||
- name: Set up dummy Hexo site | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: hexojs/hexo-theme-unit-test | ||
path: hexo-theme-unit-test | ||
- name: Install hexo-theme-landscape | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: hexojs/hexo-theme-landscape | ||
path: hexo-theme-unit-test/hexo-theme-landscape | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: npm install | ||
run: npm install --silent | ||
working-directory: hexo-theme-unit-test | ||
- name: Cache NPM dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: hexo-theme-unit-test/node_modules | ||
key: ${{ runner.OS }}-profiling-npm-cache | ||
restore-keys: ${{ runner.OS }}-profiling-npm-cache | ||
- name: Replace node_modules/hexo | ||
run: | | ||
rm -rf node_modules/hexo | ||
ln -sf $GITHUB_WORKSPACE node_modules/hexo | ||
working-directory: hexo-theme-unit-test | ||
- name: Start test run | ||
run: npx --no-install hexo clean | ||
working-directory: hexo-theme-unit-test | ||
- name: Generating flamegraph | ||
run: npx 0x --name ${{ matrix.node-version }} --output-dir "${GITHUB_WORKSPACE}/0x" -- npx --no-install hexo g; | ||
working-directory: hexo-theme-unit-test | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: profiling-results | ||
path: ${{ github.workspace }}/0x |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.