-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 1.66 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
name: Tests CI
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
path: main
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- 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
- 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-activity-content-*.tgz ../dsnp-activity-content.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-activity-content.tgz
npm test