51 lines (41 loc) · 1.24 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
name: Benchmark Suite
on: [pull_request]
jobs:
build:
name: Benchmark npm/cli
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
node-version: [10.x, 12.x]
runs-on: ${{ matrix.os }}
steps:
# Checkout the npm/cli repo
- uses: actions/checkout@v1
# Installs the specific version of nodejs
- name: Use nodejs ${{ matrix.node-version}}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Uninstall global npm
- name: Unlink npm/cli
run: node bin/npm-cli.js rm npm -g -f
# Link npm/cli
- name: Globally link npm/cli
run: node bin/npm-cli.js link -f
# Validate npm/cli is current commit
- name: Validate link npm/cli
run: |
echo "Global npm Packages:"
npm ls -g --depth=0 || exit 0
echo "Command Path:"
which npm
echo "Global node_modules:"
ls -l "$(dirname $(which npm))/../lib/node_modules"
echo "Current Working Directory:"
pwd
echo "Current Commit:"
git log --oneline -1
# Run benchmark suite
- name: Run benchmarking
run: LOG_LEVEL=verbose npm run benchmark