Switch the tests-done job to an Action (#12161)

I've factored it out for easier use in other workflows.
This commit is contained in:
Richard van der Hoff 2022-03-07 12:24:06 +00:00 committed by GitHub
parent 00a67f831a
commit 0211f18d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 20 deletions

View File

@ -388,34 +388,22 @@ jobs:
tests-done:
if: ${{ always() }}
needs:
- check-sampleconfig
- lint
- lint-crlf
- lint-newsfile
- trial
- trial-olddeps
- sytest
- export-data
- portdb
- complement
runs-on: ubuntu-latest
steps:
- name: Set build result
env:
NEEDS_CONTEXT: ${{ toJSON(needs) }}
# the `jq` incantation dumps out a series of "<job> <result>" lines.
# we set it to an intermediate variable to avoid a pipe, which makes it
# hard to set $rc.
run: |
rc=0
results=$(jq -r 'to_entries[] | [.key,.value.result] | join(" ")' <<< $NEEDS_CONTEXT)
while read job result ; do
# The newsfile lint may be skipped on non PR builds
if [ $result == "skipped" ] && [ $job == "lint-newsfile" ]; then
continue
fi
- uses: matrix-org/done-action@v2
with:
needs: ${{ toJSON(needs) }}
if [ "$result" != "success" ]; then
echo "::set-failed ::Job $job returned $result"
rc=1
fi
done <<< $results
exit $rc
# The newsfile lint may be skipped on non PR builds
skippable:
lint-newsfile

1
changelog.d/12161.misc Normal file
View File

@ -0,0 +1 @@
Use a prebuilt Action for the `tests-done` CI job.