Skip to content

Commit 7e299d2

Browse files
committed
check opencvsharp
1 parent 1e0ae29 commit 7e299d2

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

.github/workflows/opencvsharp.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths: [ '.github/workflows/opencvsharp.yml' ]
7+
workflow_dispatch:
8+
9+
env:
10+
OPENCVSHARP_VERSION: 4.10.0.20241024
11+
12+
jobs:
13+
build:
14+
name: Build OpenCvSharp
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Download OpenCV Artifacts
22+
run: |
23+
echo "Fetching latest run of opencv.yml on branch ${GITHUB_REF_NAME}"
24+
RUN_ID=$(gh run list --workflow=opencv.yml --branch=${GITHUB_REF_NAME} --status=success --limit=1 --json id | jq -r '.[0].id')
25+
echo "Latest opencv run ID: $RUN_ID"
26+
27+
echo "Downloading artifact 'opencv' from run ${RUN_ID}"
28+
gh run download $RUN_ID --name opencv-linux-x64 --dir artifacts
29+
30+
ls -lR artifacts
31+
32+
# - name: Checkout OpenCvSharp
33+
# uses: actions/checkout@v4
34+
# with:
35+
# repository: shimat/opencvsharp
36+
# ref: ${{ env.OPENCVSHARP_VERSION }}
37+
# path: opencvsharp
38+
39+
# - name: Apply Patches
40+
# run: |
41+
# cd opencvsharp
42+
# git apply ../eng/opencvsharp.patch
43+
44+
# - name: Configure OpenCvSharp
45+
# run: |
46+
# cd opencvsharp && mkdir build && cd build && \
47+
# cmake \
48+
# -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/opencvsharp/build \
49+
# -D OpenCV_DIR=${{ github.workspace }}/opencv/build \
50+
# ../src
51+
52+
# - name: Build OpenCvSharp
53+
# run: |
54+
# cd opencvsharp/build && make -j$(nproc)
55+
56+
# - name: Show OpenCvSharp Artifacts
57+
# run: |
58+
# cd opencvsharp/build
59+
# ls -lR
60+
# ldd OpenCvSharpExtern/libOpenCvSharpExtern.so
61+
62+
# - name: Test OpenCvSharp
63+
# run: |
64+
# mkdir test && cd test && echo '#include <stdio.h>
65+
# int core_Mat_sizeof();
66+
# int main()
67+
# {
68+
# int i = core_Mat_sizeof();
69+
# printf("sizeof(Mat) = %d\n", i);
70+
# return 0;
71+
# }' > test.c
72+
# gcc test.c -L../opencvsharp/build/OpenCvSharpExtern -lOpenCvSharpExtern -o test
73+
74+
# - name: Run Test
75+
# run: |
76+
# export LD_LIBRARY_PATH=${{ github.workspace }}/opencvsharp/build/OpenCvSharpExtern:$LD_LIBRARY_PATH
77+
# cd test && ./test
78+
79+
# - name: Make artifacts
80+
# run: |
81+
# mkdir artifacts && cd artifacts && mkdir lib test
82+
# cp -r ../opencvsharp/build/OpenCvSharpExtern/libOpenCvSharpExtern.so ./lib
83+
# cp -r ../test/* ./test
84+
# ls -lR
85+
86+
# - name: Upload Artifacts
87+
# uses: actions/upload-artifact@v4
88+
# with:
89+
# name: opencvsharp-${{ env.OPENCVSHARP_VERSION }}-ubuntu-linux-x64
90+
# path: artifacts

0 commit comments

Comments
 (0)