From 823d6fc38b7afdd296455829958c3aaa65962dc5 Mon Sep 17 00:00:00 2001 From: urielch Date: Tue, 16 Apr 2024 10:05:02 +0200 Subject: [PATCH] update all workflow --- .github/workflows/prebuild-linux.yml | 15 ++-- .github/workflows/prebuild-mac.yml | 73 +++++++++++++++++++ ...{win64-prebuild.yml => prebuild-win64.yml} | 4 +- 3 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/prebuild-mac.yml rename .github/workflows/{win64-prebuild.yml => prebuild-win64.yml} (96%) diff --git a/.github/workflows/prebuild-linux.yml b/.github/workflows/prebuild-linux.yml index fe615361f..247e9e3c2 100644 --- a/.github/workflows/prebuild-linux.yml +++ b/.github/workflows/prebuild-linux.yml @@ -42,30 +42,31 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install OpenCV ${{ matrix.opencv_version }} - run: | - sudo apt update - sudo apt install libopencv-dev - - name: Install Node.js ${{ matrix.node_version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} + cache: 'pnpm' + - name: Install OpenCV ${{ matrix.opencv_version }} + run: | + sudo apt update + sudo apt install libopencv-dev + - uses: pnpm/action-setup@v3 name: Install pnpm with: version: 8 run_install: | - recursive: true - args: [--frozen-lockfile, --strict-peer-dependencies] + args: [--strict-peer-dependencies] - name: pnpm run prepack run: pnpm run prepack - name: install deps in test working-directory: ./test - run: pnpm install --frozen-lockfile + run: pnpm install - name: run test-appveyor test working-directory: ./test diff --git a/.github/workflows/prebuild-mac.yml b/.github/workflows/prebuild-mac.yml new file mode 100644 index 000000000..a50fc1e0b --- /dev/null +++ b/.github/workflows/prebuild-mac.yml @@ -0,0 +1,73 @@ +name: Use openCV from Brew + +on: + push: + branches: [ "master" ] + paths: + - "cc/**" + - "install/**" + - "lib/**" + - "test/**" + - "typings/**" + - "package.json" + - ".github/workflows/prebuild-mac.yml" + pull_request: + branches: [ "master" ] + paths: + - "cc/**" + - "install/**" + - "lib/**" + - "test/**" + - "typings/**" + - "package.json" + - ".github/workflows/prebuild-mac.yml" + +env: + OPENCV4NODEJS_DISABLE_AUTOBUILD: 1 + +permissions: + contents: read + +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + opencv_version: + - 4 + node_version: + # - 16 + # - 18 + - 20 + + steps: + - uses: actions/checkout@v4 + - name: Install Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install OpenCV ${{ matrix.opencv_version }} + run: | + brew install opencv@${{ matrix.opencv_version }} + + + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + run_install: | + - recursive: true + args: [--strict-peer-dependencies] + + - name: pnpm run prepack + run: pnpm run prepack + + - name: install deps in test + working-directory: ./test + run: pnpm install + + - name: run test-appveyor test + working-directory: ./test + run: pnpm run test-appveyor diff --git a/.github/workflows/win64-prebuild.yml b/.github/workflows/prebuild-win64.yml similarity index 96% rename from .github/workflows/win64-prebuild.yml rename to .github/workflows/prebuild-win64.yml index 1f5d6e9cf..624122b7f 100644 --- a/.github/workflows/win64-prebuild.yml +++ b/.github/workflows/prebuild-win64.yml @@ -10,7 +10,7 @@ on: - "test/**" - "typings/**" - "package.json" - - ".github/workflows/win64-prebuild.yml" + - ".github/workflows/prebuild-win64.yml" pull_request: branches: [ "master" ] paths: @@ -20,7 +20,7 @@ on: - "test/**" - "typings/**" - "package.json" - - ".github/workflows/win64-prebuild.yml" + - ".github/workflows/prebuild-win64.yml" env: # Path to the solution file relative to the root of the project.