Moving function templates to extensions-templates #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate Rust Functions | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| paths: | |
| - "functions-*-rs/**" | |
| - ".github/workflows/validate-rust-functions.yml" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| project: | |
| - functions-local-pickup-delivery-option-generators | |
| - functions-pickup-point-delivery-option-generators | |
| - functions-location-rules | |
| - functions-fulfillment-constraints | |
| - functions-discount | |
| - functions-shipping-discounts | |
| - functions-product-discounts | |
| - functions-order-discounts | |
| - functions-discounts-allocator | |
| - functions-payment-customization | |
| - functions-delivery-customization | |
| - functions-cart-transform | |
| - functions-cart-checkout-validation | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Add rustfmt and clippy | |
| run: rustup component add rustfmt clippy | |
| - name: Install node dependencies | |
| run: yarn | |
| - name: Expand liquid for ${{ matrix.project }} | |
| working-directory: . | |
| run: CI=1 yarn expand-liquid rust ${{ matrix.project }} | |
| - name: Run cargo fmt for ${{ matrix.project }} | |
| working-directory: ./${{ matrix.project }}-rs/default | |
| run: cargo fmt --check | |
| - name: Run clippy for ${{ matrix.project }} | |
| working-directory: ./${{ matrix.project }}-rs/default | |
| run: cargo clippy -- -D warnings | |
| - name: Run tests for ${{ matrix.project }} | |
| working-directory: ./${{ matrix.project }}-rs/default | |
| run: cargo test | |
| - name: Add wasm32-wasip1 target | |
| run: rustup target add wasm32-wasip1 | |
| - name: Build ${{ matrix.project }} with wasm32-wasip1 target | |
| working-directory: ./${{ matrix.project }}-rs/default | |
| run: cargo build --release --target wasm32-wasip1 |