-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (88 loc) · 2.99 KB
/
Copy pathci.yml
File metadata and controls
101 lines (88 loc) · 2.99 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
pull_request:
branches: [main]
jobs:
verify:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: TypeScript checks
run: |
pnpm exec tsc --noEmit --project packages/react/tsconfig.json
pnpm exec tsc --noEmit --project packages/nextjs/tsconfig.json
pnpm exec tsc --noEmit --project packages/angular/tsconfig.json
- name: Unit tests
run: pnpm test
- name: Verify package.json validity
run: |
node -e "
['react', 'nextjs', 'vue', 'angular'].forEach(pkg => {
const fs = require('fs');
const path = 'packages/' + pkg + '/package.json';
try {
JSON.parse(fs.readFileSync(path, 'utf8'));
console.log('OK: ' + path);
} catch (e) {
console.error('FAIL: ' + path + ' -- ' + e.message);
process.exit(1);
}
});
"
- name: Verify JS source files parse
run: |
node --check packages/react/src/index.js
- name: Verify consistent URLs across packages
run: |
node -e "
const fs = require('fs');
const files = [
'packages/react/src/index.js',
'packages/react/src/index.tsx',
'packages/nextjs/src/index.tsx',
'packages/vue/src/AparsoftChatbot.vue',
'packages/angular/src/aparsoft-chatbot.component.ts',
];
const loaderUrl = 'https://www.aparsoft.com/static/chatbot-widget/widget.loader.js';
let ok = true;
files.forEach(f => {
const content = fs.readFileSync(f, 'utf8');
if (!content.includes(loaderUrl)) {
console.error('FAIL: ' + f + ' missing loader URL');
ok = false;
} else {
console.log('OK: ' + f);
}
});
if (!ok) process.exit(1);
"
- name: Verify directory structure
run: |
ls packages/react/src/index.js
ls packages/react/src/index.tsx
ls packages/nextjs/src/index.tsx
ls packages/vue/src/AparsoftChatbot.vue
ls packages/angular/src/aparsoft-chatbot.component.ts
ls examples/vanilla-html/index.html
ls docs/getting-started.md
ls docs/configuration.md
ls docs/theming.md
ls docs/ssr-guide.md
ls docs/api-reference.md
ls docs/wordpress-guide.md
ls wordpress/aparsoft-chatbot.php
ls wordpress/readme.txt
ls CODE_OF_CONDUCT.md
ls README.md
ls LICENSE