Skip to content

test on ubuntu20/22/24 #6

test on ubuntu20/22/24

test on ubuntu20/22/24 #6

name: Test-OpenCvSharp
on:
push:
branches: [ main ]
paths: [ '.github/workflows/test-opencvsharp.yml' ]
workflow_dispatch:
jobs:
build:
name: Test OpenCvSharp
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
steps:
- name: Download OpenCvSharp Artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "Fetching lastest run of opencvsharp.yml on branch ${{ github.ref_name }}"
RUN_ID=$(gh run list -R ${{ github.repository }} --workflow=opencvsharp.yml --branch=${{ github.ref_name }} --status=success --limit=1 --json databaseId | jq -r '.[0].databaseId')
echo "Latest opencvsharp run ID: $RUN_ID"
echo "Downloading artifact 'opencvsharp' from run ${RUN_ID}"
gh run download -R ${{ github.repository }} $RUN_ID --name opencvsharp-linux-x64 --dir opencvsharp
ls -lR opencvsharp
- name: Create test.c
run: |
mkdir test && cd test && echo '#include <stdio.h>
int core_Mat_sizeof();
int main()
{
int i = core_Mat_sizeof();
printf("sizeof(Mat) = %d\n", i);
return 0;
}' > test.c
cat test.c
- name: Build Test
run: |
cd test
gcc test.c -L../opencvsharp/lib -lOpenCvSharpExtern -o test
- name: Run Test
run: |
export LD_LIBRARY_PATH=${{ github.workspace }}/opencvsharp/lib:$LD_LIBRARY_PATH
cd test && ./test
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: test-linux-x64-${{ matrix.os }}
path: test