-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (38 loc) · 1.31 KB
/
rs-run-cli-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: '[rs] Run CLI Tests'
on:
workflow_call:
inputs:
sources_ref:
description: 'Sources Ref'
type: string
required: false
jobs:
test_cli:
name: Run CLI Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ inputs.sources_ref }}
- name: Free Disk Space
uses: ./.github/actions/free-disk-space
- name: Install wasm-opt
uses: ./.github/actions/install-wasm-utils
- name: Build CLI
run: |
cargo build -p sails-cli
- name: Generate MyDemo via CLI
run: |
TEMPLATES_BRANCH=${{ inputs.sources_ref }}
TEMPLATES_BRANCH=${TEMPLATES_BRANCH:-${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}}
echo "TEMPLATES_BRANCH: $TEMPLATES_BRANCH"
SAILS_CLI_TEMPLATES_BRANCH=${TEMPLATES_BRANCH} ./target/debug/cargo-sails sails program ~/tmp --name my-demo
- name: Run Tests on MyDemo
run: |
cd ~/tmp/my-demo
cargo test -p my-demo
- name: Generate IDL from MyDemo via CLI
run: |
./target/debug/cargo-sails sails idl --manifest-path ~/tmp/my-demo/Cargo.toml
diff ~/tmp/my-demo/target/my-demo-app.idl ~/tmp/my-demo/target/wasm32-unknown-unknown/debug/my_demo.idl