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
33 changes: 33 additions & 0 deletions .github/actions/build-foundation/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build DataWeave foundation
description: >-
Shared foundation for the DataWeave CLI workflows: sets up Gradle and GraalVM,
then runs the single `gradlew build` that compiles both native images (the CLI
`dw` and the `dwlib` shared library). Callers must run actions/checkout BEFORE
this action, then invoke the per-artifact actions (cli/python/node/native-lib)
AFTER it in the same job so Gradle up-to-date checks reuse the compiled images.
inputs:
github-token:
description: Token for graalvm/setup-graalvm component downloads.
required: true
native-version:
description: >-
Value passed as -PnativeVersion to Gradle. Empty string omits the flag
(the build then uses the nativeVersion default).
required: false
default: ''
runs:
using: composite
steps:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Setup Graalvm
uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
distribution: 'graalvm-community'
github-token: ${{ inputs.github-token }}

- name: Run Build
run: ./gradlew --stacktrace --no-problems-report -PskipNodeTests=true build ${{ inputs.native-version != '' && format('-PnativeVersion={0}', inputs.native-version) || '' }}
shell: bash
77 changes: 77 additions & 0 deletions .github/actions/cli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CLI artifact
description: >-
Produces the DataWeave `dw` CLI distro zip; optionally runs the master-only
native-cli regression/TCK suites; optionally publishes the distro as a CI
artifact (main) or a release asset (release). Requires build-foundation to
have run earlier in the same job.
inputs:
native-version:
description: -PnativeVersion value; empty omits the flag.
required: false
default: ''
run-tck:
description: When 'true', run the master-only native-cli regression suites.
required: false
default: 'false'
publish:
description: "'none' | 'artifact' | 'release'."
required: false
default: 'none'
repo-token:
description: Token for svenstaro release upload (publish=release).
required: false
default: ''
arch:
description: Runtime arch token for artifact/asset names.
required: false
default: ''
script-name:
description: OS naming token (linux/windows/macos) for artifact/asset names.
required: false
default: ''
distro-os:
description: Gradle distro classifier (linux/windows/osx) for the source zip name.
required: false
default: ''
tag:
description: Release tag (publish=release).
required: false
default: ''
runs:
using: composite
steps:
- name: Create Distro
run: ./gradlew --stacktrace --no-problems-report native-cli:distro ${{ inputs.native-version != '' && format('-PnativeVersion={0}', inputs.native-version) || '' }}
shell: bash

- name: Run regression test 2.12.2-SNAPSHOT
if: inputs.run-tck == 'true'
run: ./gradlew --stacktrace -PweaveTestSuiteVersion=2.12.2-SNAPSHOT -DweaveSuiteVersion=2.12.2-SNAPSHOT native-cli-integration-tests:test
shell: bash

- name: Run regression test 2.13.0-SNAPSHOT
if: inputs.run-tck == 'true'
run: ./gradlew --stacktrace -PweaveTestSuiteVersion=2.13.0-SNAPSHOT -DweaveSuiteVersion=2.13.0-SNAPSHOT native-cli-integration-tests:test
shell: bash

- name: Stage renamed CLI distro
if: inputs.publish == 'artifact'
run: cp "native-cli/build/distributions/native-cli-${{ inputs.native-version }}-native-distro-${{ inputs.distro-os }}.zip" "native-cli/build/distributions/dw-cli-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.zip"
shell: bash

- name: Upload CLI distro (artifact)
if: inputs.publish == 'artifact'
uses: actions/upload-artifact@v7.0.1
with:
path: native-cli/build/distributions/dw-cli-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.zip
archive: false

- name: Upload binaries to release
if: inputs.publish == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-cli/build/distributions/native-cli-${{ inputs.native-version }}-native-distro-${{ inputs.distro-os }}.zip
asset_name: dw-cli-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.zip
tag: ${{ inputs.tag }}
overwrite: true
88 changes: 88 additions & 0 deletions .github/actions/native-lib/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Native shared library artifact
description: >-
Stages and publishes the raw dwlib shared library (dwlib.so/.dll/.dylib) and
its C header (dwlib.h) — the FFI surface both the Python and Node bindings
embed, published here as standalone downloads. Requires build-foundation
earlier in the same job.
inputs:
native-version:
description: -PnativeVersion value; empty omits the flag.
required: false
default: ''
publish:
description: "'none' | 'artifact' | 'release'."
required: false
default: 'none'
repo-token:
description: Token for svenstaro release upload (publish=release).
required: false
default: ''
arch:
description: Runtime arch token for artifact/asset names.
required: false
default: ''
script-name:
description: OS naming token (linux/windows/macos) for artifact/asset names.
required: false
default: ''
tag:
description: Release tag (publish=release).
required: false
default: ''
runs:
using: composite
steps:
- name: Stage native shared library
run: ./gradlew --stacktrace --no-problems-report native-lib:stagePythonNativeLib ${{ inputs.native-version != '' && format('-PnativeVersion={0}', inputs.native-version) || '' }}
shell: bash

- name: Upload native shared library (artifact)
if: inputs.publish == 'artifact'
uses: actions/upload-artifact@v7.0.1
with:
name: dwlib-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}
path: |
native-lib/python/src/dataweave/native/dwlib.dylib
native-lib/python/src/dataweave/native/dwlib.so
native-lib/python/src/dataweave/native/dwlib.dll
native-lib/python/src/dataweave/native/dwlib.h

- name: Upload native shared library to release (Linux)
if: inputs.publish == 'release' && runner.os == 'Linux'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/src/dataweave/native/dwlib.so
asset_name: dwlib-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.so
tag: ${{ inputs.tag }}
overwrite: true

- name: Upload native shared library to release (Windows)
if: inputs.publish == 'release' && runner.os == 'Windows'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/src/dataweave/native/dwlib.dll
asset_name: dwlib-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.dll
tag: ${{ inputs.tag }}
overwrite: true

- name: Upload native shared library to release (macOS)
if: inputs.publish == 'release' && runner.os == 'macOS'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/src/dataweave/native/dwlib.dylib
asset_name: dwlib-${{ inputs.native-version }}-${{ inputs.script-name }}-${{ inputs.arch }}.dylib
tag: ${{ inputs.tag }}
overwrite: true

- name: Upload native library header to release
if: inputs.publish == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/src/dataweave/native/dwlib.h
asset_name: dwlib-${{ inputs.native-version }}.h
tag: ${{ inputs.tag }}
overwrite: true
87 changes: 87 additions & 0 deletions .github/actions/node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Node artifact
description: >-
Sets up Node.js, builds the DataWeave Node package (which embeds dwlib), and
runs the Node unit/integration tests (always). Optionally runs the master-only
Node TCK conformance lane, and optionally publishes the .tgz as a CI artifact
(main) or a release asset (release). Requires build-foundation earlier in the
same job.
inputs:
native-version:
description: -PnativeVersion value; empty omits the flag.
required: false
default: ''
run-tck:
description: When 'true', run the master-only Node TCK conformance lane.
required: false
default: 'false'
publish:
description: "'none' | 'artifact' | 'release'."
required: false
default: 'none'
repo-token:
description: Token for svenstaro release upload (publish=release).
required: false
default: ''
arch:
description: Runtime arch token for artifact/asset names.
required: false
default: ''
script-name:
description: OS naming token (linux/windows/macos) for artifact/asset names.
required: false
default: ''
tag:
description: Release tag (publish=release).
required: false
default: ''
runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Create Native Lib Node Package
run: ./gradlew --stacktrace --no-problems-report native-lib:buildNodePackage ${{ inputs.native-version != '' && format('-PnativeVersion={0}', inputs.native-version) || '' }}
shell: bash

- name: Run Node.js Tests
run: ./gradlew --stacktrace --no-problems-report native-lib:nodeTest ${{ inputs.native-version != '' && format('-PnativeVersion={0}', inputs.native-version) || '' }}
shell: bash

- name: Run Node.js TCK Conformance 2.12.2-SNAPSHOT
if: inputs.run-tck == 'true'
run: |
./gradlew --stacktrace --no-problems-report -PweaveTestSuiteVersion=2.12.2-SNAPSHOT native-lib:stageTckSuites
cd native-lib/node && npm run test:tck
shell: bash

- name: Run Node.js TCK Conformance 2.13.0-SNAPSHOT
if: inputs.run-tck == 'true'
run: |
./gradlew --stacktrace --no-problems-report -PweaveTestSuiteVersion=2.13.0-SNAPSHOT native-lib:stageTckSuites
cd native-lib/node && npm run test:tck
shell: bash

- name: Stage OS-qualified Node package
if: inputs.publish == 'artifact'
run: cp native-lib/node/dataweave-native-0.0.1.tgz "native-lib/node/dataweave-node-0.0.1-${{ inputs.script-name }}-${{ inputs.arch }}.tgz"
shell: bash

- name: Upload Node package (artifact)
if: inputs.publish == 'artifact'
uses: actions/upload-artifact@v7.0.1
with:
path: native-lib/node/dataweave-node-0.0.1-${{ inputs.script-name }}-${{ inputs.arch }}.tgz
archive: false

- name: Upload Node package to release
if: inputs.publish == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/node/dataweave-native-0.0.1.tgz
asset_name: dataweave-node-0.0.1-${{ inputs.script-name }}-${{ inputs.arch }}.tgz
tag: ${{ inputs.tag }}
overwrite: true
57 changes: 57 additions & 0 deletions .github/actions/python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Python artifact
description: >-
Installs Python build dependencies and builds the DataWeave Python wheel
(which embeds dwlib); optionally publishes the wheel as a CI artifact (main)
or a release asset (release). No TCK phase today. Requires build-foundation to
have run earlier in the same job.
inputs:
native-version:
description: -PnativeVersion value; empty omits the flag.
required: false
default: ''
break-system-packages:
description: >-
When 'true', add --break-system-packages to the pip install (required on
GitHub-hosted runners per PEP 668; not needed on self-hosted mulesoft
runners).
required: false
default: 'false'
publish:
description: "'none' | 'artifact' | 'release'."
required: false
default: 'none'
repo-token:
description: Token for svenstaro release upload (publish=release).
required: false
default: ''
tag:
description: Release tag (publish=release).
required: false
default: ''
runs:
using: composite
steps:
- name: Install Python build dependencies
run: python3 -m pip install ${{ inputs.break-system-packages == 'true' && '--break-system-packages' || '' }} --upgrade setuptools wheel
shell: bash

- name: Create Native Lib Python Wheel
run: ./gradlew --stacktrace --no-problems-report native-lib:buildPythonWheel ${{ inputs.native-version != '' && format('-PnativeVersion={0}', inputs.native-version) || '' }}
shell: bash

- name: Upload Python wheel (artifact)
if: inputs.publish == 'artifact'
uses: actions/upload-artifact@v7.0.1
with:
path: native-lib/python/dist/dataweave_native-0.0.1-py3-*.whl
archive: false

- name: Upload Python wheel to release
if: inputs.publish == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ inputs.repo-token }}
file: native-lib/python/dist/dataweave_native-0.0.1-py3-none-*.whl
file_glob: true
tag: ${{ inputs.tag }}
overwrite: true
Loading
Loading