@@ -29,67 +29,48 @@ permissions:
2929 contents : read
3030
3131jobs :
32- linting :
33- name : Reuse linting job
34- uses : ./.github/workflows/lint.yml
32+ lint :
33+ uses : reqstool/.github/.github/workflows/python-lint.yml@ci/385-shared-python-build # SPIKE: pin to release SHA
3534
3635 build :
37- needs : linting
38- runs-on : ubuntu-latest
39- strategy :
40- fail-fast : false
41- matrix :
42- reqstool-source : [pypi, main]
43- steps :
44- # Full history and tags: hatch-vcs derives the version from git state, so a
45- # shallow clone would build the wrong number rather than fail.
46- - name : Check out source repository
47- uses : actions/checkout@v7.0.1
48- with :
49- persist-credentials : false
50- fetch-depth : 0
51- fetch-tags : true
52- ref : ${{ inputs.ref || github.ref }}
53- - name : Set up Python
54- uses : actions/setup-python@v7.1.0
55- with :
56- python-version : " 3.13.18"
57- - name : Install dependencies
58- # renovate: datasource=pypi depName=hatch
59- run : pip install hatch==1.18.2
60- - name : Run tests
61- run : hatch run dev:pytest --junitxml=build/junit.xml --cov=reqstool_python_decorators --cov-report=xml:build/coverage.xml
62- - name : Build project
63- run : hatch build
64- - name : Self-apply own decorator processor to own src/tests
65- # Relies on `hatch build` (above) not cleaning build/ -- annotations.yml lands
66- # alongside the junit/coverage output from the "Run tests" step, and
67- # reqstool_config.yml expects to find both there. If hatch build ever starts
68- # cleaning build/, move the pytest output dir outside of it.
69- run : hatch run dev:python scripts/generate_annotations.py
70- - name : Install reqstool
71- uses : reqstool/.github/.github/actions/install-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
72- with :
73- reqstool-source : ${{ matrix.reqstool-source }}
74- - name : Validate reqstool spec completeness
75- # not yet available in the latest PyPI release; supplementary to (not a
76- # replacement for) the `reqstool status --fail-if-incomplete` gate below, which
77- # is the actual required check on the pypi leg
78- if : matrix.reqstool-source == 'main'
79- uses : reqstool/.github/.github/actions/validate-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
80- - name : Run reqstool status
81- # Required gate on both matrix legs -- fails the build unless every
82- # requirement is implemented and verified.
83- uses : reqstool/.github/.github/actions/reqstool-status@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
84- with :
85- fail-if-incomplete : " true"
86- # Upload artifacts for later use
87- - name : Upload Artifacts
88- if : matrix.reqstool-source == 'pypi'
89- uses : actions/upload-artifact@v7.0.2
90- with :
91- name : ${{ inputs.artifact-name || 'dist' }}
92- path : dist/
36+ needs : lint
37+ uses : reqstool/.github/.github/workflows/python-build-hatch.yml@ci/385-shared-python-build # SPIKE: pin to release SHA
38+ with :
39+ coverage-source : reqstool_python_decorators
40+ ref : ${{ inputs.ref }}
41+ artifact-name : ${{ inputs.artifact-name || 'dist' }}
42+ # Relies on build/ surviving `hatch build`: annotations.yml lands next to
43+ # the junit/coverage output, and reqstool_config.yml expects them there.
44+ post-test-command : hatch run dev:python scripts/generate_annotations.py
45+
46+ reqstool :
47+ needs : build
48+ uses : reqstool/.github/.github/workflows/common-reqstool-verify.yml@ci/385-shared-python-build # SPIKE: pin to release SHA
49+ with :
50+ ref : ${{ inputs.ref }}
51+ build-artifact : ${{ inputs.artifact-name || 'dist' }}-build
52+
53+ smoke :
54+ needs : build
55+ uses : reqstool/.github/.github/workflows/python-smoke.yml@ci/385-shared-python-build # SPIKE: pin to release SHA
56+ with :
57+ ref : ${{ inputs.ref }}
58+ dist-artifact : ${{ inputs.artifact-name || 'dist' }}
59+ # Same self-apply run as the build job, but from the installed wheel on
60+ # Windows/macOS: reads every src/tests file, writes annotations.yml (#109).
61+ command : python scripts/generate_annotations.py
9362
9463 validate-openspec :
9564 uses : reqstool/.github/.github/workflows/common-validate-openspec.yml@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1
65+
66+ # Single stable required check: survives job renames and matrix changes.
67+ ci :
68+ if : ${{ always() }}
69+ needs : [lint, build, reqstool, smoke, validate-openspec]
70+ runs-on : ubuntu-latest
71+ steps :
72+ - name : Fail unless every needed job succeeded
73+ env :
74+ NEEDS : ${{ toJSON(needs) }}
75+ run : |
76+ echo "$NEEDS" | python3 -c 'import json,sys; r={k:v["result"] for k,v in json.load(sys.stdin).items()}; print(r); sys.exit(0 if all(v=="success" for v in r.values()) else 1)'
0 commit comments