Skip to content
Draft
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
30 changes: 30 additions & 0 deletions .github/workflows/validate-js-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,33 @@ jobs:
run: yarn js-typegen
- name: Test
run: yarn js-test
- name: Test function execution
run: |
# Install Shopify CLI
npm install -g @shopify/cli

# Test each JS function
for func_dir in functions-*-js; do
if [ -d "$func_dir" ]; then
echo "Testing function execution for $func_dir"

# Copy app config to function directory and run from there
cp shopify.app.toml "$func_dir/"
cd "$func_dir"

# Build function to wasm
shopify app function build

# Create empty input
echo '{}' > input.json

# Run function with empty input
shopify app function run --input input.json --json

echo "Function $func_dir executed successfully"

# Clean up and return to root
rm shopify.app.toml input.json
cd ..
fi
done
30 changes: 30 additions & 0 deletions .github/workflows/validate-rust-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,33 @@ jobs:
run: rustup target add wasm32-wasip1
- name: Build with wasm32-wasip1 target
run: cargo build --release --target wasm32-wasip1
- name: Test function execution
run: |
# Install Shopify CLI
npm install -g @shopify/cli

# Test each Rust function
for func_dir in functions-*-rs; do
if [ -d "$func_dir" ]; then
echo "Testing function execution for $func_dir"

# Copy app config to function directory and run from there
cp shopify.app.toml "$func_dir/"
cd "$func_dir"

# Build function to wasm
shopify app function build

# Create empty input
echo '{}' > input.json

# Run function with empty input
shopify app function run --input input.json --json

echo "Function $func_dir executed successfully"

# Clean up and return to root
rm shopify.app.toml input.json
cd ..
fi
done
30 changes: 30 additions & 0 deletions .github/workflows/validate-ts-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,33 @@ jobs:
run: yarn js-typegen
- name: Test
run: yarn js-test
- name: Test function execution
run: |
# Install Shopify CLI
npm install -g @shopify/cli

# Test each JS function (includes TS functions)
for func_dir in functions-*-js; do
if [ -d "$func_dir" ]; then
echo "Testing function execution for $func_dir"

# Copy app config to function directory and run from there
cp shopify.app.toml "$func_dir/"
cd "$func_dir"

# Build function to wasm
shopify app function build

# Create empty input
echo '{}' > input.json

# Run function with empty input
shopify app function run --input input.json --json

echo "Function $func_dir executed successfully"

# Clean up and return to root
rm shopify.app.toml input.json
cd ..
fi
done
30 changes: 30 additions & 0 deletions .github/workflows/validate-wasm-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,33 @@ jobs:
run: yarn
- name: Expand liquid for TypeScript functions
run: CI=1 yarn expand-liquid wasm
- name: Test function execution
run: |
# Install Shopify CLI
npm install -g @shopify/cli

# Test each WASM function
for func_dir in functions-*-wasm; do
if [ -d "$func_dir" ]; then
echo "Testing function execution for $func_dir"

# Copy app config to function directory and run from there
cp shopify.app.toml "$func_dir/"
cd "$func_dir"

# Build function to wasm
shopify app function build

# Create empty input
echo '{}' > input.json

# Run function with empty input
shopify app function run --input input.json --json

echo "Function $func_dir executed successfully"

# Clean up and return to root
rm shopify.app.toml input.json
cd ..
fi
done
10 changes: 10 additions & 0 deletions shopify.app.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
client_id = "cce73c955015bde64a40f32619843cad"
name = "ci-test-app"
application_url = "https://example.com"
embedded = true

[auth]
redirect_urls = ["https://example.com/auth/callback"]

[webhooks]
api_version = "2024-01"
Loading