-
-
Notifications
You must be signed in to change notification settings - Fork 16
131 lines (105 loc) · 4.03 KB
/
Copy pathbuild.yml
File metadata and controls
131 lines (105 loc) · 4.03 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Node.js CI (plugin) v. 2.0.7
# Path: .github/workflows/build.yml
name: Node.js CI
on:
push:
paths-ignore:
- '**/*.md' # any .md anywhere
pull_request:
paths-ignore:
- '**/*.md' # any .md anywhere
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Node.js 20.19 is still supported in package.json, but it is not tested in CI as it has reached EOL.
node-version: [22.x, 24.x, 26.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Verify Node.js version
run: node -v
- name: Verify Npm version
run: npm -v
- name: Select matterbridge branch
id: select_matterbridge_ref
shell: pwsh
run: |
$pkg = Get-Content -Raw -Path package.json | ConvertFrom-Json
$workflowRef = $pkg.automator.workflow
if ($workflowRef) {
$ref = $workflowRef
} else {
$ref = if ('${{ github.event_name }}' -eq 'push') { 'dev' } else { 'main' }
}
"ref=$ref" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Clone matterbridge repo branch ${{ steps.select_matterbridge_ref.outputs.ref }}
run: git clone --depth 1 --single-branch --no-tags -b ${{ steps.select_matterbridge_ref.outputs.ref }} https://github.com/Luligu/matterbridge.git ../matterbridge
- name: Install matterbridge dependencies
working-directory: ../matterbridge
run: npm ci --no-fund --no-audit
- name: Build matterbridge
working-directory: ../matterbridge
run: npm run build
- name: Link matterbridge globally
working-directory: ../matterbridge
run: npm link --no-fund --no-audit
- name: Install plugin dependencies
run: npm ci --no-fund --no-audit
- name: Link matterbridge in the plugin
run: npm link matterbridge --no-fund --no-audit
- name: Build the plugin
run: npm run build
- name: Typecheck the plugin
run: npm run typecheck
- name: Lint the plugin
run: npm run lint
- name: Check the plugin frontend
id: check_frontend
shell: bash
run: echo "has_frontend=$(test -f apps/frontend/package.json && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Install the frontend dependencies
if: steps.check_frontend.outputs.has_frontend == 'true'
working-directory: apps/frontend
run: npm ci --no-fund --no-audit
- name: Build the frontend
if: steps.check_frontend.outputs.has_frontend == 'true'
working-directory: apps/frontend
run: npm run build
- name: Typecheck the frontend
if: steps.check_frontend.outputs.has_frontend == 'true'
working-directory: apps/frontend
run: npm run typecheck
- name: Lint the frontend
if: steps.check_frontend.outputs.has_frontend == 'true'
working-directory: apps/frontend
run: npm run lint
- name: Check config files
id: check_configs
shell: bash
run: |
echo "has_jest=$(test -f jest.config.js && echo true || echo false)" >> $GITHUB_OUTPUT
echo "has_vitest=$(test -f vite.config.ts && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Run Jest tests
if: steps.check_configs.outputs.has_jest == 'true'
shell: bash
run: |
npm run test -- --testTimeout=30000
- name: Run Vitest tests
if: steps.check_configs.outputs.has_vitest == 'true'
shell: bash
run: |
if [ "${{ steps.check_configs.outputs.has_jest }}" == "true" ]; then
npm run test:vitest -- --testTimeout=30000
else
npm run test -- --testTimeout=30000
fi