-
Notifications
You must be signed in to change notification settings - Fork 249
55 lines (55 loc) · 2.24 KB
/
test_examples.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
48
49
50
51
52
53
54
55
name: Test Examples
on:
push:
branches:
- master
pull_request:
env:
RUSTFLAGS: -D warnings
jobs:
test:
runs-on: ${{ matrix.platform }}
name: "${{ matrix.example }} - ${{ matrix.platform }}"
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
toolchain: [1.81]
# toolchain: [stable]
example: [
adder,
callback-results,
cross-contract-calls,
factory-contract,
fungible-token,
non-fungible-token,
versioned
]
steps:
- uses: actions/checkout@v3
- name: "${{ matrix.toolchain }} with rustfmt, and wasm32"
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v1
with:
working-directory: ./examples/${{ matrix.example }}
- name: Build status-message, factory-contract && test factory-contract
if: matrix.example == 'factory-contract'
env:
RUSTFLAGS: '-C link-arg=-s'
run: |
cargo +${{ matrix.toolchain }} build --manifest-path="./examples/status-message/Cargo.toml" --target wasm32-unknown-unknown --release --all
cp ./examples/status-message/target/wasm32-unknown-unknown/release/*.wasm ./examples/status-message/res/
cargo +${{ matrix.toolchain }} build --manifest-path=./examples/factory-contract/Cargo.toml --target wasm32-unknown-unknown --release --all
cp ./examples/factory-contract/target/wasm32-unknown-unknown/release/*.wasm ./examples/factory-contract/res/
cargo +${{ matrix.toolchain }} test --manifest-path=./examples/factory-contract/Cargo.toml --all
- name: Build
env:
RUSTFLAGS: '-C link-arg=-s'
run: |
cargo +${{ matrix.toolchain }} build --manifest-path="./examples/${{matrix.example}}/Cargo.toml" --target wasm32-unknown-unknown --release --all &&
cp ./examples/${{matrix.example}}/target/wasm32-unknown-unknown/release/*.wasm ./examples/${{matrix.example}}/res/
- name: Test
run: cargo +${{ matrix.toolchain }} test --manifest-path="./examples/${{ matrix.example }}/Cargo.toml" --all