@@ -14,6 +14,9 @@ inputs:
1414 bindgen-args :
1515 description : " bindgen arguments for generating BSD bindings. Non-empty enables binding generation."
1616 default : " "
17+ nss-version-check :
18+ description : " Whether to check the system NSS version against the minimum required by nss-rs."
19+ default : " true"
1720
1821runs :
1922 using : composite
2528 PLATFORM : ${{ inputs.platform }}
2629 WORKSPACE : ${{ inputs.working-directory == '.' && '--workspace' || '' }}
2730 BINDGEN_ARGS : ${{ inputs.bindgen-args }}
31+ NSS_VERSION_CHECK : ${{ inputs.nss-version-check }}
2832 run : |
33+ # Minimum NSS version required by nss-rs, so that we can detect a too-old system NSS below.
34+ if [ "$NSS_VERSION_CHECK" = "true" ]; then
35+ NSS_MIN_VERSION=$(cargo metadata --locked --format-version=1 -q \
36+ | jq -r '.packages[] | select(.name=="nss-rs") | .metadata.nss["min-version"]')
37+ case "$NSS_MIN_VERSION" in
38+ *[!0-9.]*|"") echo "Could not determine minimum NSS version"; exit 1 ;;
39+ esac
40+ fi
41+
2942 cat <<EOF > prepare.sh
3043 # This executes as root
3144 set -ex
5568 set -ex
5669 cd "$WD"
5770 pwd
71+ NSS_MIN_VERSION='$NSS_MIN_VERSION'
72+ if [ -n "\$NSS_MIN_VERSION" ]; then
73+ if ! pkg-config --exists nss; then
74+ echo "::warning::No nss.pc on $PLATFORM, cannot check the NSS version"
75+ elif ! pkg-config --atleast-version="\$NSS_MIN_VERSION" nss; then
76+ echo "Skipping $PLATFORM: system NSS \$(pkg-config --modversion nss) is older than the required \$NSS_MIN_VERSION" > nss-skipped.txt
77+ echo "::warning::\$(cat nss-skipped.txt)"
78+ exit 0
79+ fi
80+ fi
5881 case "$PLATFORM" in
5982 openbsd) export LIBCLANG_PATH=/usr/local/llvm21/lib
6083 export LLVM_COV=/usr/local/llvm21/bin/llvm-cov
@@ -123,7 +146,7 @@ runs:
123146 echo "envs=CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG RUST_TEST_TIME_UNIT RUST_TEST_TIME_INTEGRATION RUST_TEST_TIME_DOCTEST WD" >> "$GITHUB_OUTPUT"
124147
125148 - if : ${{ inputs.platform == 'freebsd' }}
126- uses : vmactions/freebsd-vm@a6de9343ef5747433d9c25784c90e84998b9d69a # v1.4.6
149+ uses : vmactions/freebsd-vm@4469451fe39bee80be4066836c5170362e9349f3 # v1.5.7
127150 with :
128151 usesh : true
129152 disable-cache : true
@@ -133,7 +156,7 @@ runs:
133156 run : ${{ steps.prep.outputs.run }}
134157
135158 - if : ${{ inputs.platform == 'openbsd' }}
136- uses : vmactions/openbsd-vm@fcf799d7ce9c305ad89eabef1fb2fa5c1c42d0ee # v1.4.3
159+ uses : vmactions/openbsd-vm@86cdc08415d9d0865267e686561e276c52d62530 # v1.4.7
137160 with :
138161 usesh : true
139162 disable-cache : true
@@ -143,7 +166,7 @@ runs:
143166 run : ${{ steps.prep.outputs.run }}
144167
145168 - if : ${{ inputs.platform == 'netbsd' }}
146- uses : vmactions/netbsd-vm@99816dccf75edf233ed6cd00a159e3a5b85ea373 # v1.4 .0
169+ uses : vmactions/netbsd-vm@20ee93a005c9fc78743e6e05269f4cb023b87413 # v1.5 .0
147170 with :
148171 usesh : true
149172 disable-cache : true
@@ -153,7 +176,7 @@ runs:
153176 run : ${{ steps.prep.outputs.run }}
154177
155178 - if : ${{ inputs.platform == 'solaris' }}
156- uses : vmactions/solaris-vm@d30dd6c228c8661ade859e36ead7660b9a62efcc # v1.3.7
179+ uses : vmactions/solaris-vm@a11f407d3720a3717673d4194f19ee63b284977e # v1.4.0
157180 with :
158181 release : " 11.4-gcc"
159182 usesh : true
@@ -163,14 +186,22 @@ runs:
163186 prepare : ${{ steps.prep.outputs.prepare }}
164187 run : ${{ steps.prep.outputs.run }}
165188
189+ - shell : bash
190+ env :
191+ WORKING_DIR : ${{ inputs.working-directory }}
192+ run : |
193+ if [ -f "$WORKING_DIR/nss-skipped.txt" ]; then
194+ echo "### $(cat "$WORKING_DIR/nss-skipped.txt")" >> "$GITHUB_STEP_SUMMARY"
195+ fi
196+
166197 - id : check-coverage
167198 shell : bash
168199 env :
169200 WORKING_DIR : ${{ inputs.working-directory }}
170201 run : test -f "$WORKING_DIR/codecov.json" && echo "exists=true" >> "$GITHUB_OUTPUT" || true
171202
172203 - if : ${{ steps.check-coverage.outputs.exists == 'true' }}
173- uses : codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
204+ uses : codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
174205 with :
175206 files : codecov.json
176207 working-directory : ${{ inputs.working-directory }}
0 commit comments