@@ -28,12 +28,12 @@ jobs:
2828
2929 # Work-out whether we need to re-build the examples. We need to re-build the
3030 # examples if either _any_ fo the examples has changed, or the WASM cache
31- # has expired
31+ # has expired, or the ./funcs folder have changed
3232 needs-build :
3333 if : github.event.pull_request.draft == false
3434 runs-on : ubuntu-latest
3535 outputs :
36- needs-wasm : ${{ steps.wasm-cache.outputs.cache-hit != 'true' }}
36+ needs-wasm : ${{ ( steps.wasm-cache.outputs.cache-hit != 'true') || (steps.filter.outputs.funcs-changed == 'true') }}
3737 steps :
3838 - name : " Checkout code"
3939 uses : actions/checkout@v4
5252 path : ./wasm
5353 key : wasm-${{ steps.submodule-commit.outputs.digest }}
5454 lookup-only : true
55+ # Check if any of the submodules have been modified
56+ - uses : dorny/paths-filter@v3
57+ id : filter
58+ with :
59+ filters : |
60+ funcs-changed:
61+ - 'func/**'
62+
5563
5664 build-examples :
5765 needs : needs-build
7381 rustup default stable
7482 rustup target add wasm32-wasip1
7583 ./bin/inv_wrapper.sh rabe jwt
84+ - name : " Build OpenCV"
85+ run : ./bin/inv_wrapper.sh opencv
7686 - name : " Build FFmpeg"
7787 run : ./bin/inv_wrapper.sh ffmpeg
7888 - name : " Build ImageMagick"
@@ -93,14 +103,22 @@ jobs:
93103 run : ./bin/inv_wrapper.sh tensorflow
94104 - name : " Build PolyBench/C"
95105 run : ./bin/inv_wrapper.sh polybench polybench --native
106+ - name : " Manually re-compile libz (the sysroot has a version with atomics)"
107+ run : |
108+ git submodule update --init
109+ ./bin/inv_wrapper.sh zlib
110+ working-directory : ./cpp
96111 - name : " Build functions used in the tests"
97112 run : ./bin/inv_wrapper.sh func.tests
98113 - name : " Get CPP/Python commits"
99114 id : submodule-commit
100115 run : |
101116 apt install -y zstd
102117 git config --global --add safe.directory "$GITHUB_WORKSPACE"
103- echo "digest=$(git submodule status | awk '{ print $1; }' | md5sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
118+ submodule_digest=$(git submodule status | awk '{ print $1; }' | md5sum | awk '{ print $1}')
119+ func_digest=$(find 'func' -type f -exec md5sum {} + | sort | md5sum | awk '{ print $1 }')
120+ echo "${submodule_digest}-${func_digest}"
121+ echo "digest=$(echo -n '${submodule_digest}-${func_digest}' | md5sum | awk '{ print $1 }')" >> $GITHUB_OUTPUT
104122 # Also move to a different path to restore from
105123 mv /usr/local/faasm/wasm ./wasm
106124 # If we are here we _always_ want to overwrite the cache
@@ -168,7 +186,11 @@ jobs:
168186 run : |
169187 sudo apt install -y zstd
170188 git config --global --add safe.directory "$GITHUB_WORKSPACE"
171- echo "digest=$(git submodule status | awk '{ print $1; }' | md5sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
189+ submodule_digest=$(git submodule status | awk '{ print $1; }' | md5sum | awk '{ print $1}')
190+ func_digest=$(find 'func' -type f -exec md5sum {} + | sort | md5sum | awk '{ print $1 }')
191+ echo "${submodule_digest}-${func_digest}"
192+ echo "digest=$(echo -n '${submodule_digest}-${func_digest}' | md5sum | awk '{ print $1 }')" >> $GITHUB_OUTPUT
193+ # echo "digest=$(git submodule status | awk '{ print $1; }' | md5sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
172194 - name : " Get WASM cache"
173195 uses : actions/cache/restore@v4
174196 id : cpp-wasm-cache
@@ -182,6 +204,14 @@ jobs:
182204 - name : " Print logs if wasm-upload fails"
183205 if : failure() && (steps.wasm-upload.outcome == 'failure')
184206 run : faasmctl logs -s upload
207+ - name : " Run OpenCV check"
208+ if : " contains(env.FAASM_WASM_VM, 'wamr')"
209+ timeout-minutes : 2
210+ run : faasmctl invoke opencv pca --cmdline "faasm://opencv/composers"
211+ - name : " Run OpenCV k-NN Inference"
212+ if : " contains(env.FAASM_WASM_VM, 'wamr')"
213+ timeout-minutes : 2
214+ run : faasmctl invoke opencv check --cmdline "faasm://opencv/bus_photo.bmp faasm://opencv/out.bmp"
185215 - name : " Run MPI kernels"
186216 timeout-minutes : 2
187217 run : |
0 commit comments