forked from google/pprof-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 5
76 lines (70 loc) · 2.08 KB
/
build.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build
on:
pull_request:
push:
branches:
- main
jobs:
asan:
strategy:
matrix:
version: [16, 18, 20, 22]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: npm install
- run: npm run test:js-asan
valgrind:
strategy:
matrix:
version: [16, 18, 20, 22]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: sudo apt-get update && sudo apt-get install valgrind
- run: npm install
- run: npm run test:js-valgrind
build:
uses: Datadog/action-prebuildify/.github/workflows/build.yml@main
with:
target-name: 'dd_pprof' # target name in binding.gyp
package-manager: 'npm' # npm or yarn
cache: true # enable caching of dependencies based on lockfile
min-node-version: 16
skip: 'linux-arm linux-ia32' # skip building for these platforms
dev_publish:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
environment: npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v4
with:
name: prebuilds
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
- run: npm install
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "::set-output name=json::$content"
- run: npm version --no-git-tag-version ${{ fromJson(steps.pkg.outputs.json).version }}-$(git rev-parse --short HEAD)+${{ github.run_id }}.${{ github.run_attempt }}
- run: npm publish --tag dev
build-successful:
if: always()
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Determine if everything is passing
run: exit 1
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}