CONTRIBUTING said unsigned commits are rejected and nothing enforced it, so the DCO was caught by hand at review time. That is a full round-trip for a trailer, on top of however long the fork's first run waits for approval. Own job, so it reports separately from the code gates and costs nothing on push. Presence only: whether a trailer that doesn't match the author is acceptable is a reviewer's call, whether one exists at all is not. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
66 lines
2.5 KiB
YAML
66 lines
2.5 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches: [develop, main, contrib]
|
|
pull_request:
|
|
branches: [develop, main, contrib]
|
|
jobs:
|
|
# Separate job so a missing sign-off reports on its own and doesn't hide behind the code
|
|
# gates, and so it costs nothing on push. Checks that the trailer is present, not that it
|
|
# matches the author — a mismatch is a judgement call for a reviewer, an absent trailer
|
|
# is not, and telling a contributor on their first push beats telling them on review.
|
|
dco:
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Every commit needs a Signed-off-by
|
|
env:
|
|
RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
|
run: |
|
|
missing=0
|
|
for sha in $(git rev-list --no-merges "$RANGE"); do
|
|
if ! git show -s --format='%(trailers:key=Signed-off-by,valueonly)' "$sha" | grep -q '[^[:space:]]'; then
|
|
echo "::error::no Signed-off-by: $(git show -s --format='%h %s' "$sha")"
|
|
missing=1
|
|
fi
|
|
done
|
|
if [ "$missing" = 1 ]; then
|
|
echo "We use the DCO instead of a CLA. See CONTRIBUTING.md."
|
|
echo "Fix the whole branch with: git rebase --signoff ${{ github.event.pull_request.base.sha }}"
|
|
echo "Then: git push --force-with-lease"
|
|
exit 1
|
|
fi
|
|
echo "All commits signed off."
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
- run: npm ci
|
|
- run: npm run lint
|
|
- run: npm run format:check
|
|
- run: npm run complexity:check
|
|
- run: npm run typecheck
|
|
- run: npm test
|
|
- run: npm run build
|
|
# Supply chain, deliberately after the code gates: an advisory published by a third party
|
|
# must never decide whether a contributor gets to see their own lint and typecheck output.
|
|
# Only what we ship blocks — with `reflect-metadata` as the sole runtime dependency, a
|
|
# production advisory is rare and genuinely reaches users. Build tooling only reports.
|
|
- run: npm audit --omit=dev
|
|
- run: npm audit
|
|
continue-on-error: true
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22.12'
|
|
- run: npm ci --prefix website
|
|
- run: npm audit --prefix website
|
|
continue-on-error: true
|
|
- run: npm run docs:build
|