Skip to content

Commit 94e3cd5

Browse files
committed
Add rust function validation - for this branch only for now
1 parent 1d1b53f commit 94e3cd5

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Validate Rust Functions
2+
3+
on:
4+
push:
5+
branches: ["ot.functions-examples"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
checks:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
project:
18+
- functions-local-pickup-delivery-option-generators-rs
19+
- functions-pickup-point-delivery-option-generators-rs
20+
- functions-location-rules-rs
21+
- functions-fulfillment-constraints-rs
22+
- functions-discount-rs
23+
- functions-shipping-discounts-rs
24+
- functions-product-discounts-rs
25+
- functions-order-discounts-rs
26+
- functions-discounts-allocator-rs
27+
- functions-payment-customization-rs
28+
- functions-delivery-customization-rs
29+
- functions-cart-transform-rs
30+
- functions-cart-checkout-validation-rs
31+
steps:
32+
- uses: actions/checkout@v3
33+
- name: Add rustfmt and clippy
34+
run: rustup component add rustfmt clippy
35+
- name: Install node dependencies
36+
run: yarn
37+
- name: Expand liquid for ${{ matrix.project }}
38+
working-directory: ./${{ matrix.project }}
39+
run: CI=1 yarn expand-liquid .
40+
- name: Run cargo fmt for ${{ matrix.project }}
41+
working-directory: ./${{ matrix.project }}
42+
run: cargo fmt --check
43+
- name: Run clippy for ${{ matrix.project }}
44+
working-directory: ./${{ matrix.project }}
45+
run: cargo clippy -- -D warnings
46+
- name: Run tests for ${{ matrix.project }}
47+
working-directory: ./${{ matrix.project }}
48+
run: cargo test
49+
- name: Add wasm32-wasip1 target
50+
run: rustup target add wasm32-wasip1
51+
- name: Build ${{ matrix.project }} with wasm32-wasip1 target
52+
working-directory: ./${{ matrix.project }}
53+
run: cargo build --release --target wasm32-wasip1

0 commit comments

Comments
 (0)