From 718ae13e19491979da91fefcc166ea2c21694fd7 Mon Sep 17 00:00:00 2001 From: Mehdi Salemi Date: Thu, 26 Jun 2025 09:28:20 -0400 Subject: [PATCH 1/2] add function integration test --- .../workflows/validate-function-templates.yml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/validate-function-templates.yml diff --git a/.github/workflows/validate-function-templates.yml b/.github/workflows/validate-function-templates.yml new file mode 100644 index 00000000..8637c79b --- /dev/null +++ b/.github/workflows/validate-function-templates.yml @@ -0,0 +1,52 @@ +name: Validate Function Templates + +on: + pull_request: + branches: ["main"] + paths: + - "functions-*/**" + - ".github/workflows/validate-function-templates.yml" + push: + branches: ["main"] + paths: + - "functions-*/**" + +env: + CARGO_TERM_COLOR: always + +jobs: + validate-templates: + runs-on: ubuntu-latest + strategy: + matrix: + flavor: [javascript, typescript, rust] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + + - name: Install Node.js dependencies + run: yarn + + - name: Install Rust toolchain (Rust only) + if: matrix.flavor == 'rust' + run: rustup target add wasm32-wasip1 + + - name: Expand liquid templates for ${{ matrix.flavor }} + run: CI=1 yarn expand-liquid ${{ matrix.flavor }} + + - name: Install workspace dependencies (JS/TS only) + if: matrix.flavor == 'javascript' || matrix.flavor == 'typescript' + run: yarn + + - name: Generate types (JS/TS only) + if: matrix.flavor == 'javascript' || matrix.flavor == 'typescript' + run: yarn js-typegen + + - name: Run tests (JS/TS only) + if: matrix.flavor == 'javascript' || matrix.flavor == 'typescript' + run: yarn js-test + + - name: Build Rust WASM target (Rust only) + if: matrix.flavor == 'rust' + run: cargo build --release --target wasm32-wasip1 \ No newline at end of file From b2d06200e23db1e67fc2a462cc274d7b927802d4 Mon Sep 17 00:00:00 2001 From: Mehdi Salemi Date: Thu, 26 Jun 2025 09:43:02 -0400 Subject: [PATCH 2/2] add rust test check --- .github/workflows/validate-function-templates.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/validate-function-templates.yml b/.github/workflows/validate-function-templates.yml index 8637c79b..a5c9e3e4 100644 --- a/.github/workflows/validate-function-templates.yml +++ b/.github/workflows/validate-function-templates.yml @@ -47,6 +47,10 @@ jobs: if: matrix.flavor == 'javascript' || matrix.flavor == 'typescript' run: yarn js-test + - name: Run Rust tests (Rust only) + if: matrix.flavor == 'rust' + run: cargo test + - name: Build Rust WASM target (Rust only) if: matrix.flavor == 'rust' run: cargo build --release --target wasm32-wasip1 \ No newline at end of file