This repository has been archived by the owner on Dec 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (64 loc) · 1.83 KB
/
main.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
name: Tests CI
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
jobs:
test:
runs-on: ubuntu-20.04
services:
ganache:
image: dsnp/hardhat:v1.0.1
ports:
- 8545:8545
steps:
- name: Checkout SDK
uses: actions/checkout@v2
with:
path: main
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.14.0'
- name: Install
run: npm ci
working-directory: ./main
- name: Lint
run: npm run lint
working-directory: ./main
- name: Danger
run: npx danger ci --dangerfile ./dangerfile.ts
working-directory: ./main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: npm run test
working-directory: ./main
env:
RPC_URL: http://localhost:8545
TESTING_PRIVATE_KEY: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
- name: Build
run: npm run build
working-directory: ./main
- name: Publish Dry Run
run: npm publish --dry-run
working-directory: ./main/dist
- name: Pack up for testing project import
run: |
npm pack
mv dsnp-sdk-*.tgz ../dsnp-sdk.tgz
working-directory: ./main/dist
# This needs to happen in a non-subfolder of the sdk to prevent resolving from a parent dir node_modules
- name: Test Project Import
run: |
cp -r ./main/src/test/importTest ./
cd importTest
npm i ../main/dsnp-sdk.tgz
npm test