Skip to content

Commit

Permalink
update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
UrielCh committed Apr 24, 2024
1 parent 1c7dc93 commit 524a95b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 217 deletions.
36 changes: 8 additions & 28 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,22 @@ name: build openCV on ubuntu

on:
push:
branches: [ "master", "piercus", "test" ]
paths: ['src/**', 'dist/**', 'package.json', 'pnpm-lock.yaml', 'pnpmfile.js', 'test/**', 'bin/**', 'scripts/**', '.github/workflows/linux-build.yml' ]
branches: [ "master", "piercus", "test", "deno" ]
paths: ['src/**', '.github/workflows/linux-build.yml' ]
pull_request:
branches: [ "master", "piercus" ]
paths: ['src/**', 'dist/**', 'package.json', 'pnpm-lock.yaml', 'pnpmfile.js', 'test/**', 'bin/**', 'scripts/**', '.github/workflows/linux-build.yml' ]
paths: ['src/**', '.github/workflows/linux-build.yml' ]

#env:
# OPENCV4NODEJS_AUTOBUILD_OPENCV_VERSION : 4.7.0

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
# node-version: [14.x, 16.x, 18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
#- name: Install cmake
# run: sudo apt-get install -y cmake
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.14.0
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: denoland/setup-deno@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm run build
- name: node bin/main.js --version 4.9.0
run: node bin/main.js
- run: pnpm test
deno-version: v1.x
- name: deno run -A main.ts --version 4.9.0
run: deno run -A main.ts --version 4.9.0
- run: deno test -A
26 changes: 7 additions & 19 deletions .github/workflows/linux-detect.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Use OpenCV from Ubuntu apt
on:
push:
branches: [ "never", "master", "test" ]
paths: ['src/**', 'dist/**', 'package.json', 'pnpm-lock.yaml', 'pnpmfile.js', 'test/**', 'bin/**', 'scripts/**', '.github/workflows/linux-detect.yml' ]
branches: [ "never", "master", "deno" ]
paths: ['src/**', 'src/*.ts', '.github/workflows/linux-detect.yml' ]
# pull_request:
# branches: [ "master" ]
jobs:
Expand All @@ -20,24 +20,12 @@ jobs:
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: denoland/setup-deno@v1
with:
version: 8.14.0
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
deno-version: v1.x
- name: Install OpenCV ${{ matrix.opencv_version }}
run: |
sudo apt update
sudo apt install libopencv-dev
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- run: pnpm run build
# --prebuild=latestBuild
echo sudo apt update; sudo apt install libopencv-dev
- name: Detect OpenCV
run: node bin/main.js --verbose
- run: pnpm test
run: deno run -A main.ts --verbose
- run: deno test -A
23 changes: 6 additions & 17 deletions .github/workflows/mac-detect.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Use OpenCV from Brew
on:
push:
branches: [ "never", "master", "test" ]
paths: ['src/**', 'dist/**', 'package.json', 'pnpm-lock.yaml', 'pnpmfile.js', 'test/**', 'bin/**', 'scripts/**', '.github/workflows/mac-detect.yml' ]
branches: [ "never", "master", "deno" ]
paths: ['src/**', '*.ts', '.github/workflows/mac-detect.yml' ]
# pull_request:
# branches: [ "master" ]
jobs:
Expand All @@ -20,23 +20,12 @@ jobs:
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: denoland/setup-deno@v1
with:
version: 8.14.0
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
deno-version: v1.x
- name: Install OpenCV ${{ matrix.opencv_version }}
run: |
brew install opencv@${{ matrix.opencv_version }}
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- run: pnpm run build
# --prebuild=latestBuild
- name: Detect OpenCV
run: node bin/main.js --verbose
- run: pnpm test
run: deno run -A main.ts --verbose
- run: deno test -A
24 changes: 6 additions & 18 deletions .github/workflows/w64-detect.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Use openCV from Chocolatey
on:
push:
branches: [ "never", "test" ]
paths: ['src/**', 'dist/**', 'package.json', 'pnpm-lock.yaml', 'pnpmfile.js', 'test/**', 'bin/**', 'scripts/**', '.github/workflows/w64-detect.yml' ]
branches: [ "never", "test", "deno" ]
paths: ['src/**', '*.ts', '.github/workflows/w64-detect.yml' ]
# pull_request:
# branches: [ "master" ]
jobs:
Expand All @@ -20,24 +20,12 @@ jobs:
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: denoland/setup-deno@v1
with:
version: 8.14.0
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
deno-version: v1.x
- name: Install OpenCV ${{ matrix.opencv_version }}
run: |
choco install OpenCV -y --version ${{ matrix.opencv_version }}
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- run: pnpm run build
# --prebuild=latestBuild
- name: Detect OpenCV
run: node bin/main.js --verbose
- run: pnpm test
run: deno run -A main.ts --verbose
- run: deno test -A
131 changes: 0 additions & 131 deletions .vscode/launch.json

This file was deleted.

24 changes: 20 additions & 4 deletions _build_npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function buildDnt() {
"justadudewhohacks (https://github.com/justadudewhohacks)",
],
description:
"Script to auto build recent OpenCV + contrib via npm 2023 Edition",
"Script to auto build recent OpenCV + contrib via npm 2024 Edition",
keywords: [
"opencv",
"build",
Expand All @@ -72,7 +72,12 @@ export async function buildDnt() {
url: `https://github.com/UrielCh/${prj}/issues`,
},
bin: {
// "opencv-build-npm": "main.js",
"opencv-build-npm": "script/main.js",
},
scripts: {
"checkExports": "npx @arethetypeswrong/cli $(npm pack)",
"install_macm1": "node script/main.js --version 4.9.0 --flag=\"-DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64\"",
"install_4_9_0_cuda_30XX": "npm run build && cross-env OPENCV4NODEJS_DISABLE_AUTOBUILD= node bin/main.js --keepsource --version 4.9.0 --cuda --cudaArch=8.6",
},
"engine-strict": {
node: ">=18",
Expand All @@ -84,10 +89,21 @@ export async function buildDnt() {
await emptyDir("./npm");

await build({
entryPoints: ["./mod.ts"], // , "main.ts"
entryPoints: [
{
kind: "export",
name: ".",
path: "mod.ts",
},
{
kind: "bin",
name: "opencv-build-npm",
path: "main.ts",
// path: "script/main.js",
}],
outDir: "./npm",
test: true,
declaration: "separate",
// declaration: "separate",
shims: {
// see JS docs for overview and more options
deno: true,
Expand Down

0 comments on commit 524a95b

Please sign in to comment.