1313
1414 strategy :
1515 matrix :
16- os : [ubuntu-20.04, ubuntu- 22.04, ubuntu-24.04]
16+ os : [ubuntu-22.04, ubuntu-24.04]
1717
1818 steps :
1919 - name : Download OpenCvSharp Artifacts
5454 with :
5555 name : test-linux-x64-${{ matrix.os }}
5656 path : test
57-
58- centos7-test :
59- name : Test OpenCvSharp on CentOS 7
60- runs-on : ubuntu-latest
61- steps :
62- - name : Download OpenCvSharp Artifacts
63- env :
64- GH_TOKEN : ${{ github.token }}
65- run : |
66- echo "Fetching latest run of opencvsharp.yml on branch ${{ github.ref_name }}"
67- 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')
68- echo "Latest opencvsharp run ID: $RUN_ID"
69- echo "Downloading artifact 'opencvsharp-linux-x64-ubuntu-20.04' from run ${RUN_ID}"
70- gh run download -R ${{ github.repository }} $RUN_ID --name opencvsharp-linux-x64-ubuntu-20.04 --dir opencvsharp
71- ls -lR opencvsharp
72-
73- - name : Pull centos:7 Docker image
74- run : docker pull centos:7
75-
76- - name : Start CentOS 7 container
77- run : docker run -d --name centos7_test -v "$PWD":/work -w /work centos:7 tail -f /dev/null
78-
79- - name : Reconfigure YUM cache
80- run : |
81- docker exec centos7_test bash -c "set -eux; \
82- sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/CentOS-*.repo && \
83- sed -i 's|^#baseurl=|baseurl=|g' /etc/yum.repos.d/CentOS-*.repo && \
84- sed -i 's|mirror.centos.org|vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo && \
85- yum clean all && \
86- yum makecache"
87-
88- - name : Install gcc dependency
89- run : docker exec centos7_test bash -c "set -eux; yum install -y gcc"
90-
91- - name : Prepare test code
92- run : |
93- mkdir -p test
94- echo '#include <stdio.h>
95- int core_Mat_sizeof();
96- int main()
97- {
98- int i = core_Mat_sizeof();
99- printf("sizeof(Mat) = %d\\n", i);
100- return 0;
101- }' > test/test.c
102-
103- - name : Compile test code
104- run : docker exec centos7_test bash -c "set -eux; gcc test/test.c -L./opencvsharp/lib -lOpenCvSharpExtern -o test/test"
105-
106- - name : Run test
107- run : docker exec centos7_test bash -c "set -eux; LD_LIBRARY_PATH=/work/opencvsharp/lib:\$LD_LIBRARY_PATH ./test/test"
108-
109- - name : Cleanup container
110- run : docker stop centos7_test && docker rm centos7_test
111-
112- - name : Upload Artifacts
113- uses : actions/upload-artifact@v4
114- with :
115- name : test-linux-x64-centos7
116- path : test
0 commit comments