Skip to content

Commit

Permalink
Merge a8f7b2c into 17ee23f
Browse files Browse the repository at this point in the history
  • Loading branch information
segayuu committed Jul 11, 2020
2 parents 17ee23f + a8f7b2c commit d9dea90
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/benchmark.yml
@@ -0,0 +1,35 @@
name: Benchmark

on:
push:
branchs: [ master ]
pull_request:

jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
matrix:
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-${{ matrix.node-version }}.txt
- uses: actions/upload-artifact@v2
with:
name: benchmark-results
path: benchmark-result-${{ matrix.node-version }}.txt
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Expand Up @@ -6,13 +6,13 @@ jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache NPM dependencies
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Expand Up @@ -14,8 +14,6 @@ before_script:
- chmod +x ./test/profiling.sh

script:
- echo "============== Hexo Benchmark =============="
- node ./test/benchmark.js
- ./test/profiling.sh

deploy:
Expand Down
2 changes: 1 addition & 1 deletion test/profiling.sh
Expand Up @@ -30,7 +30,7 @@ echo ""
echo "- Generating flamegraph..."

npm install 0x --silent
node ./node_modules/.bin/0x --output-dir "${TRAVIS_BUILD_DIR}/0x" -- node ./node_modules/.bin/hexo g > build.log 2>&1 ;
npx 0x --output-dir "${TRAVIS_BUILD_DIR}/0x" -- npx --no-install hexo g > build.log 2>&1 ;

echo "Flamegraph will be deployed to: https://${TRAVIS_COMMIT}-${TRAVIS_NODE_VERSION}-hexo.surge.sh/flamegraph.html"

Expand Down

0 comments on commit d9dea90

Please sign in to comment.