Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/cli/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 1 addition & 8 deletions .github/actions/python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
51 changes: 49 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions native-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 1 addition & 4 deletions native-lib/python/tests/unit/test_ci_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,19 @@ 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()

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
Expand Down
Loading