Skip to content

Commit a3de5a0

Browse files
authored
Consolidate e2e and check CI jobs (#3566)
1 parent e591aaa commit a3de5a0

4 files changed

Lines changed: 273 additions & 122 deletions

File tree

.github/workflows/test.yaml

Lines changed: 154 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -541,15 +541,8 @@ jobs:
541541
run: exit 1
542542

543543
check:
544-
name: ${{ matrix.tox_env }}
544+
name: checks
545545
runs-on: ubuntu-latest
546-
strategy:
547-
fail-fast: false
548-
matrix:
549-
tox_env:
550-
- type
551-
- docs
552-
- pkg_meta
553546
steps:
554547
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
555548
with:
@@ -559,17 +552,48 @@ jobs:
559552
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
560553
- name: Install tox
561554
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
562-
- name: Setup check suite
563-
run: tox r -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
555+
- name: Setup check suites
556+
id: setup-check-suites
557+
continue-on-error: true
558+
run: |
559+
set -uo pipefail
560+
failed=0
561+
for tox_env in type docs pkg_meta; do
562+
if ! tox r -vv --notest --skip-missing-interpreters false -e "$tox_env"; then
563+
failed=1
564+
fi
565+
done
566+
exit "$failed"
564567
env:
565568
UV_PYTHON_PREFERENCE: "only-managed"
566-
- name: Run check for ${{ matrix.tox_env }}
567-
run: tox run --skip-uv-sync --skip-pkg-install -e ${{ matrix.tox_env }}
569+
- name: Run check suites
570+
id: run-check-suites
571+
continue-on-error: true
572+
run: |
573+
set -uo pipefail
574+
failed=0
575+
for tox_env in type docs pkg_meta; do
576+
if ! tox run --skip-uv-sync --skip-pkg-install -e "$tox_env"; then
577+
failed=1
578+
fi
579+
done
580+
exit "$failed"
568581
env:
569582
UV_PYTHON_PREFERENCE: "only-managed"
583+
- name: Fail if any check suite failed
584+
if: always()
585+
run: |
586+
setup_outcome='${{ steps.setup-check-suites.outcome }}'
587+
run_outcome='${{ steps.run-check-suites.outcome }}'
570588
571-
w3c-xmlschema-e2e:
572-
name: W3C XML Schema e2e
589+
echo "setup check suites: ${setup_outcome}"
590+
echo "run check suites: ${run_outcome}"
591+
592+
[ "${setup_outcome}" = "success" ] || exit 1
593+
[ "${run_outcome}" = "success" ] || exit 1
594+
595+
e2e:
596+
name: e2e
573597
runs-on: ubuntu-latest
574598
steps:
575599
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -580,163 +604,198 @@ jobs:
580604
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
581605
- name: Install tox
582606
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
583-
- name: Setup W3C XML Schema e2e suite
584-
run: tox r -vv --notest --skip-missing-interpreters false -e w3c-xmlschema-e2e
607+
- name: Setup e2e suites
608+
id: setup-e2e-suites
609+
continue-on-error: true
610+
run: |
611+
set -uo pipefail
612+
failed=0
613+
for tox_env in \
614+
w3c-xmlschema-e2e \
615+
jsonschema-suite-conformance \
616+
asyncapi-spec-json-schemas-e2e \
617+
apache-avro-schema-pass-e2e \
618+
protobuf-official-e2e; do
619+
if ! tox r -vv --notest --skip-missing-interpreters false -e "$tox_env"; then
620+
failed=1
621+
fi
622+
done
623+
exit "$failed"
585624
env:
586625
UV_PYTHON_PREFERENCE: "only-managed"
587-
- name: Cache W3C XML Schema Test Suite
626+
- name: Restore W3C XML Schema Test Suite
588627
id: cache-w3c-xsdtests
589-
uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
628+
uses: actions/cache/restore@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
590629
with:
591630
path: .tox/w3c-xsdtests
592631
key: e2e-xsdtests-7bc3365c652a322f3d762021b3879eb92dae7e30
593632
- name: Checkout W3C XML Schema Test Suite
633+
id: checkout-w3c-xsdtests
594634
if: steps.cache-w3c-xsdtests.outputs.cache-hit != 'true'
635+
continue-on-error: true
595636
run: |
596637
git clone --filter=blob:none https://github.com/w3c/xsdtests.git .tox/w3c-xsdtests
597638
git -C .tox/w3c-xsdtests checkout 7bc3365c652a322f3d762021b3879eb92dae7e30
639+
- name: Save W3C XML Schema Test Suite
640+
if: steps.cache-w3c-xsdtests.outputs.cache-hit != 'true' && steps.checkout-w3c-xsdtests.outcome == 'success'
641+
uses: actions/cache/save@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
642+
with:
643+
path: .tox/w3c-xsdtests
644+
key: e2e-xsdtests-7bc3365c652a322f3d762021b3879eb92dae7e30
598645
- name: Run W3C XML Schema e2e suite
646+
id: run-w3c-xmlschema-e2e
647+
continue-on-error: true
599648
run: |
600649
tox run --skip-uv-sync --skip-pkg-install -e w3c-xmlschema-e2e -- \
601650
.tox/w3c-xsdtests \
602651
--expected-documents 5284 \
603652
--expected-unique-documents 5283
604653
env:
605654
UV_PYTHON_PREFERENCE: "only-managed"
606-
607-
jsonschema-suite-conformance:
608-
name: JSON-Schema-Test-Suite conformance
609-
runs-on: ubuntu-latest
610-
steps:
611-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
655+
- name: Restore JSON-Schema-Test-Suite
656+
id: cache-json-schema-test-suite
657+
uses: actions/cache/restore@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
612658
with:
613-
fetch-depth: 0
614-
persist-credentials: false
615-
- name: Install the latest version of uv
616-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
617-
- name: Install tox
618-
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
619-
- name: Setup JSON-Schema-Test-Suite conformance
620-
run: tox r -vv --notest --skip-missing-interpreters false -e jsonschema-suite-conformance
621-
env:
622-
UV_PYTHON_PREFERENCE: "only-managed"
659+
path: .tox/json-schema-test-suite
660+
key: e2e-json-schema-test-suite-fe8c2f0de2041943975932b6bf4bd882625b6cfb
623661
- name: Checkout JSON-Schema-Test-Suite
662+
id: checkout-json-schema-test-suite
663+
if: steps.cache-json-schema-test-suite.outputs.cache-hit != 'true'
664+
continue-on-error: true
624665
run: |
625666
git clone --filter=blob:none https://github.com/json-schema-org/JSON-Schema-Test-Suite.git .tox/json-schema-test-suite
626667
git -C .tox/json-schema-test-suite checkout fe8c2f0de2041943975932b6bf4bd882625b6cfb
668+
- name: Save JSON-Schema-Test-Suite
669+
if: steps.cache-json-schema-test-suite.outputs.cache-hit != 'true' && steps.checkout-json-schema-test-suite.outcome == 'success'
670+
uses: actions/cache/save@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
671+
with:
672+
path: .tox/json-schema-test-suite
673+
key: e2e-json-schema-test-suite-fe8c2f0de2041943975932b6bf4bd882625b6cfb
627674
- name: Run JSON-Schema-Test-Suite conformance
675+
id: run-jsonschema-suite-conformance
676+
continue-on-error: true
628677
run: |
629678
tox run --skip-uv-sync --skip-pkg-install -e jsonschema-suite-conformance -- \
630679
.tox/json-schema-test-suite
631680
env:
632681
UV_PYTHON_PREFERENCE: "only-managed"
633-
634-
asyncapi-spec-json-schemas-e2e:
635-
name: AsyncAPI spec JSON Schemas e2e
636-
runs-on: ubuntu-latest
637-
steps:
638-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
639-
with:
640-
fetch-depth: 0
641-
persist-credentials: false
642-
- name: Install the latest version of uv
643-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
644-
- name: Install tox
645-
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
646-
- name: Setup AsyncAPI spec JSON Schemas e2e suite
647-
run: tox r -vv --notest --skip-missing-interpreters false -e asyncapi-spec-json-schemas-e2e
648-
env:
649-
UV_PYTHON_PREFERENCE: "only-managed"
650-
- name: Cache AsyncAPI spec JSON Schemas
682+
- name: Restore AsyncAPI spec JSON Schemas
651683
id: cache-asyncapi-spec-json-schemas
652-
uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
684+
uses: actions/cache/restore@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
653685
with:
654686
path: .tox/asyncapi-spec-json-schemas
655687
key: e2e-asyncapi-spec-json-schemas-469c2b2bf5ed88e0cdf1e48975b93a87c710d229
656688
- name: Checkout AsyncAPI spec JSON Schemas
689+
id: checkout-asyncapi-spec-json-schemas
657690
if: steps.cache-asyncapi-spec-json-schemas.outputs.cache-hit != 'true'
691+
continue-on-error: true
658692
run: |
659693
git clone --filter=blob:none https://github.com/asyncapi/spec-json-schemas.git .tox/asyncapi-spec-json-schemas
660694
git -C .tox/asyncapi-spec-json-schemas checkout 469c2b2bf5ed88e0cdf1e48975b93a87c710d229
695+
- name: Save AsyncAPI spec JSON Schemas
696+
if: steps.cache-asyncapi-spec-json-schemas.outputs.cache-hit != 'true' && steps.checkout-asyncapi-spec-json-schemas.outcome == 'success'
697+
uses: actions/cache/save@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
698+
with:
699+
path: .tox/asyncapi-spec-json-schemas
700+
key: e2e-asyncapi-spec-json-schemas-469c2b2bf5ed88e0cdf1e48975b93a87c710d229
661701
- name: Run AsyncAPI spec JSON Schemas e2e suite
702+
id: run-asyncapi-spec-json-schemas-e2e
703+
continue-on-error: true
662704
run: |
663705
tox run --skip-uv-sync --skip-pkg-install -e asyncapi-spec-json-schemas-e2e -- \
664706
.tox/asyncapi-spec-json-schemas/schemas \
665707
--expected-schemas 12
666708
env:
667709
UV_PYTHON_PREFERENCE: "only-managed"
668-
669-
apache-avro-schema-pass-e2e:
670-
name: Apache Avro schema pass e2e
671-
runs-on: ubuntu-latest
672-
steps:
673-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
674-
with:
675-
fetch-depth: 0
676-
persist-credentials: false
677-
- name: Install the latest version of uv
678-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
679-
- name: Install tox
680-
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
681-
- name: Setup Apache Avro schema pass e2e suite
682-
run: tox r -vv --notest --skip-missing-interpreters false -e apache-avro-schema-pass-e2e
683-
env:
684-
UV_PYTHON_PREFERENCE: "only-managed"
685-
- name: Cache Apache Avro
710+
- name: Restore Apache Avro
686711
id: cache-apache-avro
687-
uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
712+
uses: actions/cache/restore@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
688713
with:
689714
path: .tox/apache-avro
690715
key: e2e-apache-avro-9110c693767c1dde2665b2b57939333478b12036
691716
- name: Checkout Apache Avro
717+
id: checkout-apache-avro
692718
if: steps.cache-apache-avro.outputs.cache-hit != 'true'
719+
continue-on-error: true
693720
run: |
694721
git clone --filter=blob:none https://github.com/apache/avro.git .tox/apache-avro
695722
git -C .tox/apache-avro checkout 9110c693767c1dde2665b2b57939333478b12036
723+
- name: Save Apache Avro
724+
if: steps.cache-apache-avro.outputs.cache-hit != 'true' && steps.checkout-apache-avro.outcome == 'success'
725+
uses: actions/cache/save@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
726+
with:
727+
path: .tox/apache-avro
728+
key: e2e-apache-avro-9110c693767c1dde2665b2b57939333478b12036
696729
- name: Run Apache Avro schema pass e2e suite
730+
id: run-apache-avro-schema-pass-e2e
731+
continue-on-error: true
697732
run: |
698733
tox run --skip-uv-sync --skip-pkg-install -e apache-avro-schema-pass-e2e -- \
699734
.tox/apache-avro/lang/c/tests/schema_tests/pass \
700735
--expected-schemas 28
701736
env:
702737
UV_PYTHON_PREFERENCE: "only-managed"
703-
704-
protobuf-official-e2e:
705-
name: Protocol Buffers official e2e
706-
runs-on: ubuntu-latest
707-
steps:
708-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
709-
with:
710-
fetch-depth: 0
711-
persist-credentials: false
712-
- name: Install the latest version of uv
713-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
714-
- name: Install tox
715-
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
716-
- name: Setup Protocol Buffers official e2e suite
717-
run: tox r -vv --notest --skip-missing-interpreters false -e protobuf-official-e2e
718-
env:
719-
UV_PYTHON_PREFERENCE: "only-managed"
720-
- name: Cache Protocol Buffers
738+
- name: Restore Protocol Buffers
721739
id: cache-protobuf
722-
uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
740+
uses: actions/cache/restore@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
723741
with:
724742
path: .tox/protobuf
725743
key: e2e-protobuf-4376cba55d9e2f44f7e317d9c10e0259d145f8cf
726744
- name: Checkout Protocol Buffers
745+
id: checkout-protobuf
727746
if: steps.cache-protobuf.outputs.cache-hit != 'true'
747+
continue-on-error: true
728748
run: |
729749
git clone --filter=blob:none --no-checkout https://github.com/protocolbuffers/protobuf.git .tox/protobuf
730750
git -C .tox/protobuf sparse-checkout init --cone
731751
git -C .tox/protobuf sparse-checkout set src conformance benchmarks
732752
git -C .tox/protobuf checkout 4376cba55d9e2f44f7e317d9c10e0259d145f8cf
753+
- name: Save Protocol Buffers
754+
if: steps.cache-protobuf.outputs.cache-hit != 'true' && steps.checkout-protobuf.outcome == 'success'
755+
uses: actions/cache/save@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
756+
with:
757+
path: .tox/protobuf
758+
key: e2e-protobuf-4376cba55d9e2f44f7e317d9c10e0259d145f8cf
733759
- name: Run Protocol Buffers official e2e suite
760+
id: run-protobuf-official-e2e
761+
continue-on-error: true
734762
run: |
735763
tox run --skip-uv-sync --skip-pkg-install -e protobuf-official-e2e -- \
736764
.tox/protobuf \
737765
--expected-schemas 65
738766
env:
739767
UV_PYTHON_PREFERENCE: "only-managed"
768+
- name: Fail if any e2e suite failed
769+
if: always()
770+
run: |
771+
failed=0
772+
check_outcome() {
773+
label="$1"
774+
outcome="$2"
775+
776+
echo "${label}: ${outcome}"
777+
case "$outcome" in
778+
success|skipped)
779+
return
780+
;;
781+
esac
782+
783+
failed=1
784+
}
785+
786+
check_outcome "setup e2e suites" '${{ steps.setup-e2e-suites.outcome }}'
787+
check_outcome "checkout W3C XML Schema Test Suite" '${{ steps.checkout-w3c-xsdtests.outcome }}'
788+
check_outcome "run W3C XML Schema e2e suite" '${{ steps.run-w3c-xmlschema-e2e.outcome }}'
789+
check_outcome "checkout JSON-Schema-Test-Suite" '${{ steps.checkout-json-schema-test-suite.outcome }}'
790+
check_outcome "run JSON-Schema-Test-Suite conformance" '${{ steps.run-jsonschema-suite-conformance.outcome }}'
791+
check_outcome "checkout AsyncAPI spec JSON Schemas" '${{ steps.checkout-asyncapi-spec-json-schemas.outcome }}'
792+
check_outcome "run AsyncAPI spec JSON Schemas e2e suite" '${{ steps.run-asyncapi-spec-json-schemas-e2e.outcome }}'
793+
check_outcome "checkout Apache Avro" '${{ steps.checkout-apache-avro.outcome }}'
794+
check_outcome "run Apache Avro schema pass e2e suite" '${{ steps.run-apache-avro-schema-pass-e2e.outcome }}'
795+
check_outcome "checkout Protocol Buffers" '${{ steps.checkout-protobuf.outcome }}'
796+
check_outcome "run Protocol Buffers official e2e suite" '${{ steps.run-protobuf-official-e2e.outcome }}'
797+
798+
exit "$failed"
740799
741800
test-gate:
742801
name: test-gate
@@ -749,11 +808,7 @@ jobs:
749808
- test-shard
750809
- coverage
751810
- check
752-
- w3c-xmlschema-e2e
753-
- jsonschema-suite-conformance
754-
- asyncapi-spec-json-schemas-e2e
755-
- apache-avro-schema-pass-e2e
756-
- protobuf-official-e2e
811+
- e2e
757812
steps:
758813
- name: Fail if any test workflow job failed
759814
run: |
@@ -763,32 +818,20 @@ jobs:
763818
test_shard_result='${{ needs.test-shard.result }}'
764819
coverage_result='${{ needs.coverage.result }}'
765820
check_result='${{ needs.check.result }}'
766-
w3c_xmlschema_e2e_result='${{ needs.w3c-xmlschema-e2e.result }}'
767-
jsonschema_suite_conformance_result='${{ needs.jsonschema-suite-conformance.result }}'
768-
asyncapi_spec_json_schemas_e2e_result='${{ needs.asyncapi-spec-json-schemas-e2e.result }}'
769-
apache_avro_schema_pass_e2e_result='${{ needs.apache-avro-schema-pass-e2e.result }}'
770-
protobuf_official_e2e_result='${{ needs.protobuf-official-e2e.result }}'
821+
e2e_result='${{ needs.e2e.result }}'
771822
772823
echo "test: ${test_result}"
773824
echo "test coverage: ${test_coverage_result}"
774825
echo "test formatter coverage: ${test_formatter_coverage_result}"
775826
echo "test shard: ${test_shard_result}"
776827
echo "coverage: ${coverage_result}"
777828
echo "check: ${check_result}"
778-
echo "w3c xmlschema e2e: ${w3c_xmlschema_e2e_result}"
779-
echo "jsonschema suite conformance: ${jsonschema_suite_conformance_result}"
780-
echo "asyncapi spec json schemas e2e: ${asyncapi_spec_json_schemas_e2e_result}"
781-
echo "apache avro schema pass e2e: ${apache_avro_schema_pass_e2e_result}"
782-
echo "protobuf official e2e: ${protobuf_official_e2e_result}"
829+
echo "e2e: ${e2e_result}"
783830
784831
[ "${test_result}" = "success" ] || exit 1
785832
[ "${test_coverage_result}" = "success" ] || exit 1
786833
[ "${test_formatter_coverage_result}" = "success" ] || exit 1
787834
[ "${test_shard_result}" = "success" ] || exit 1
788835
[ "${coverage_result}" = "success" ] || exit 1
789836
[ "${check_result}" = "success" ] || exit 1
790-
[ "${w3c_xmlschema_e2e_result}" = "success" ] || exit 1
791-
[ "${jsonschema_suite_conformance_result}" = "success" ] || exit 1
792-
[ "${asyncapi_spec_json_schemas_e2e_result}" = "success" ] || exit 1
793-
[ "${apache_avro_schema_pass_e2e_result}" = "success" ] || exit 1
794-
[ "${protobuf_official_e2e_result}" = "success" ] || exit 1
837+
[ "${e2e_result}" = "success" ] || exit 1

0 commit comments

Comments
 (0)