mirror of
https://github.com/koush/scrypted.git
synced 2026-05-04 21:30:30 +01:00
CI build changed plugins (#1323)
* Fix WritableDeviceState * Fix tsconfig error * Fix test * Create build-plugins-changed.yml * Update build-sdk.yml * Update build-plugins-changed.yml
This commit is contained in:
40
.github/workflows/build-plugins-changed.yml
vendored
Normal file
40
.github/workflows/build-plugins-changed.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Build changed plugins
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths: ["plugins/**"]
|
||||
pull_request:
|
||||
paths: ["plugins/**"]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Set up base packages
|
||||
run: ./npm-install.sh
|
||||
|
||||
- name: Build changed plugins
|
||||
run: |
|
||||
# Get the list of changed directories in /plugins
|
||||
changed_dirs=$(git diff --name-only HEAD^ HEAD ./plugins | awk -F/ '{print $2}' | uniq)
|
||||
|
||||
# Loop through each changed directory
|
||||
for dir in $changed_dirs; do
|
||||
pushd "./plugins/$dir"
|
||||
echo "plugins/$dir > npm install"
|
||||
npm install
|
||||
echo "plugins/$dir > npm run build"
|
||||
npm run build
|
||||
popd
|
||||
done
|
||||
2
.github/workflows/build-sdk.yml
vendored
2
.github/workflows/build-sdk.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
- run: npm ci
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { writeFileSync } from "fs";
|
||||
import { ffmpegFilterImage } from "../src/ffmpeg-image-filter";
|
||||
import { sharpFilterImage } from "../src/sharp-image-filter";
|
||||
import path from 'path';
|
||||
|
||||
async function main1() {
|
||||
@@ -27,29 +26,4 @@ async function main1() {
|
||||
console.log('test1 done');
|
||||
}
|
||||
|
||||
async function main2() {
|
||||
const ret = await sharpFilterImage('/Users/koush/Downloads/151-1678381127261.jpg',
|
||||
{
|
||||
blur: true,
|
||||
// crop: {
|
||||
// // fractional: true,
|
||||
// left: 100,
|
||||
// top: 100,
|
||||
// width: 1000,
|
||||
// height: 500,
|
||||
// },
|
||||
brightness: -.2,
|
||||
text: {
|
||||
fontFile: path.join(__dirname, '../fs/Lato-Bold.ttf'),
|
||||
text: 'Hello World',
|
||||
}
|
||||
// }
|
||||
// { "crop": { "left": 0.216796875, "top": 0.2552083333333333, "width": 0.318359375, "height": 0.17907714843749994, "fractional": true }
|
||||
}
|
||||
);
|
||||
writeFileSync('test2.jpg', ret);
|
||||
console.log('test2 done');
|
||||
}
|
||||
|
||||
main1();
|
||||
main2();
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"sourceMap": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
"src/**/*",
|
||||
"test/**/*",
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user