diff --git a/.github/actions/cli/action.yml b/.github/actions/cli/action.yml index b8565bf2..ff57a65d 100644 --- a/.github/actions/cli/action.yml +++ b/.github/actions/cli/action.yml @@ -52,3 +52,4 @@ runs: name: cli-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }} path: native-cli/build/distributions/dw-cli-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.zip archive: false + if-no-files-found: error diff --git a/.github/actions/python/action.yml b/.github/actions/python/action.yml index 73d4b7d6..f008fe4e 100644 --- a/.github/actions/python/action.yml +++ b/.github/actions/python/action.yml @@ -55,16 +55,9 @@ runs: name: python-wheel-${{ inputs.native-version }}-${{ inputs.platform }} path: native-lib/python/dist/dataweave_native-0.0.1-py3-*.whl archive: false + if-no-files-found: error - name: Run Python TCK Conformance if: always() && inputs.run-tck == 'true' run: ./gradlew --stacktrace --no-problems-report native-lib:pythonTck shell: bash - - - name: Upload Python TCK JUnit - if: always() && inputs.run-tck == 'true' - uses: actions/upload-artifact@v7.0.1 - with: - name: python-tck-junit-${{ inputs.platform }} - path: native-lib/build/test-results/pythonTck.xml - if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f5583ca..e808164d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -85,10 +85,31 @@ jobs: permissions: contents: write steps: - - name: Download release artifacts + - name: Download CLI archives uses: actions/download-artifact@v8 with: path: release-assets + pattern: dw-cli-* + merge-multiple: true + skip-decompress: true + - name: Download Python wheels + uses: actions/download-artifact@v8 + with: + path: release-assets + pattern: dataweave_native-*.whl + merge-multiple: true + skip-decompress: true + - name: Download Node packages + uses: actions/download-artifact@v8 + with: + path: release-assets + pattern: dataweave-native-*.tgz + merge-multiple: true + - name: Download native libraries + uses: actions/download-artifact@v8 + with: + path: release-assets + pattern: dwlib-* - name: Create release and upload assets env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -118,8 +139,34 @@ jobs: fi mv "$source" "release-assets/dwlib-${VERSION}-${platform}.${extension}" done + mapfile -d '' assets < <(find release-assets -type f -name '*.zip' -print0) + if [ "${#assets[@]}" -ne 3 ]; then + echo "expected three CLI archives, found ${#assets[@]}" + exit 1 + fi + mapfile -d '' -O "${#assets[@]}" assets < <(find release-assets -type f -name '*.whl' -print0) + if [ "${#assets[@]}" -ne 6 ]; then + echo "expected three Python wheels" + exit 1 + fi + mapfile -d '' -O "${#assets[@]}" assets < <(find release-assets -type f -name '*.tgz' -print0) + if [ "${#assets[@]}" -ne 10 ]; then + echo "expected four Node packages" + exit 1 + fi + assets+=( + "release-assets/dwlib-${VERSION}-linux-x86_64.so" + "release-assets/dwlib-${VERSION}-windows-x86_64.dll" + "release-assets/dwlib-${VERSION}-macos-arm64.dylib" + "release-assets/dwlib-${VERSION}.h" + ) + for asset in "${assets[@]}"; do + if [ ! -f "$asset" ]; then + echo "release asset is missing: $asset" + exit 1 + fi + done gh release view "$TAG" || gh release create "$TAG" --generate-notes - mapfile -d '' assets < <(find release-assets -type f -print0) if [ "${#assets[@]}" -eq 0 ]; then echo "release artifacts are missing" exit 1 diff --git a/native-lib/build.gradle b/native-lib/build.gradle index d5a27e85..88bbf394 100644 --- a/native-lib/build.gradle +++ b/native-lib/build.gradle @@ -246,8 +246,7 @@ tasks.register('pythonTck', Exec) { inputs.dir("${projectDir}/python/tests/tck") inputs.dir(tckSuitesDir) inputs.file("${projectDir}/python/pytest.ini") - commandLine(pythonExe, '-m', 'pytest', '-m', 'tck', - '--junitxml', "${layout.buildDirectory.get().asFile}/test-results/pythonTck.xml") + commandLine(pythonExe, '-m', 'pytest', '-m', 'tck') } tasks.register('buildNodePackage', Exec) { diff --git a/native-lib/python/tests/unit/test_ci_structure.py b/native-lib/python/tests/unit/test_ci_structure.py index 7d6eacab..ba1d32fc 100644 --- a/native-lib/python/tests/unit/test_ci_structure.py +++ b/native-lib/python/tests/unit/test_ci_structure.py @@ -56,7 +56,7 @@ def test_python_tck_is_gated_by_the_master_only_workflow_input(): @pytest.mark.unit -def test_python_artifact_owns_test_dependencies_and_tck_junit_upload(): +def test_python_artifact_owns_test_dependencies(): root = Path(__file__).resolve().parents[4] foundation = (root / ".github/actions/build-foundation/action.yml").read_text() action = (root / ".github/actions/python/action.yml").read_text() @@ -64,14 +64,11 @@ def test_python_artifact_owns_test_dependencies_and_tck_junit_upload(): assert "Install Python test dependencies" not in foundation assert "native-lib/python[test]" in action assert "platform:" in action - assert "python-tck-junit-${{ inputs.platform }}" in action assert action.index("Create Native Lib Python Wheel") < action.index("Run Python TCK Conformance") assert action.index("Upload Python wheel (artifact)") < action.index("Run Python TCK Conformance") assert "Upload Python wheel to release" not in action assert "svenstaro/upload-release-action" not in action - assert action.index("Run Python TCK Conformance") < action.index("Upload Python TCK JUnit") assert named_step_if(action, "Run Python TCK Conformance") == "always() && inputs.run-tck == 'true'" - assert "native-lib/build/test-results/pythonTck.xml" in action @pytest.mark.unit