Skip to content

Commit ab61b10

Browse files
committed
complete everything
1 parent ee07f13 commit ab61b10

File tree

1 file changed

+46
-17
lines changed

1 file changed

+46
-17
lines changed

.github/workflows/opencv.yml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
matrix:
4646
include:
4747
- { os: linux, arch: x64, runs-on: ubuntu-22.04 }
48-
- { os: centos.7, arch: x64, runs-on: ubuntu-22.04, image: centos:7 }
48+
- { os: centos.7, arch: x64, runs-on: ubuntu-22.04, image: centos:7 }
4949
# - { os: ubuntu.24.04, arch: x64, runs-on: ubuntu-24.04 }
5050
# - { os: linux, arch: arm64, runs-on: ubuntu-22.04-arm }
5151
# - { os: ubuntu.24.04, arch: arm64, runs-on: ubuntu-24.04-arm }
@@ -117,33 +117,62 @@ jobs:
117117
118118
- name: Configure OpenCV
119119
run: |
120-
cd opencv && mkdir build && cd build
120+
script=$(
121+
cat <<'EOS'
122+
cd opencv && mkdir build && cd build
123+
EXTRA_FLAGS=""
124+
if [[ "${{ matrix.os }}" == "win" && "${{ matrix.arch }}" == "arm64" ]]; then
125+
EXTRA_FLAGS+=" -DWITH_IPP=OFF -DCPU_BASELINE=NEON -A ARM64"
126+
elif [[ "${{ matrix.os }}" == "win" && "${{ matrix.arch }}" == "x86" ]]; then
127+
EXTRA_FLAGS+=" -A Win32"
128+
fi
129+
130+
cmake ${{ env.OPENCV_CMAKE_ARGS }} $EXTRA_FLAGS ..
131+
EOS
132+
)
121133

122-
EXTRA_FLAGS=""
123-
if [[ "${{ matrix.os }}" == "win" && "${{ matrix.arch }}" == "arm64" ]]; then
124-
EXTRA_FLAGS+=" -DWITH_IPP=OFF -DCPU_BASELINE=NEON -A ARM64"
125-
elif [[ "${{ matrix.os }}" == "win" && "${{ matrix.arch }}" == "x86" ]]; then
126-
EXTRA_FLAGS+=" -A Win32"
134+
if [[ -n "${{ matrix.image }}" ]]; then
135+
bash -c "$script"
136+
else
137+
docker exec builder bash -c "$script"
127138
fi
128139

129-
cmake ${{ env.OPENCV_CMAKE_ARGS }} $EXTRA_FLAGS ..
130-
131140
- name: Build OpenCV
132141
run: |
133-
cd opencv/build
134-
if [[ "${{ matrix.os }}" =~ ^win ]]; then
135-
cmake --build . --config Release
142+
script=$(
143+
cat <<'EOS'
144+
cd opencv/build
145+
if [[ "${{ matrix.os }}" =~ ^win ]]; then
146+
cmake --build . --config Release
147+
else
148+
make -j$(nproc)
149+
fi
150+
EOS
151+
)
152+
153+
if [[ -n "${{ matrix.image }}" ]]; then
154+
bash -c "$script"
136155
else
137-
make -j$(nproc)
156+
docker exec builder bash -c "$script"
138157
fi
139158
140159
- name: Install OpenCV
141160
run: |
142-
cd opencv/build
143-
if [[ "${{ matrix.os }}" =~ ^win ]]; then
144-
cmake --install . --config Release
161+
script=$(
162+
cat <<'EOS'
163+
cd opencv/build
164+
if [[ "${{ matrix.os }}" =~ ^win ]]; then
165+
cmake --install . --config Release
166+
else
167+
make install
168+
fi
169+
EOS
170+
)
171+
172+
if [[ -n "${{ matrix.image }}" ]]; then
173+
bash -c "$script"
145174
else
146-
make install
175+
docker exec builder bash -c "$script"
147176
fi
148177
149178
- name: Show Build Artifacts

0 commit comments

Comments
 (0)