-
Notifications
You must be signed in to change notification settings - Fork 5
72 lines (63 loc) · 1.64 KB
/
contract-test.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Contract test
# Contract test runs `cargo check` and `cargo build` over the oracle contracts folder.
# This workflow is run on every pull request and push to main.
on:
pull_request:
push:
branches:
- main
- mainnet
defaults:
run:
working-directory: oracle-scripts
jobs:
Test:
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Compute diff 📜
uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.rs
Cargo.toml
Cargo.lock
- name: Setup Rust 🧰
if: env.GIT_DIFF
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Check and test 🧪
if: env.GIT_DIFF
run: |
RUSTFLAGS='-C link-arg=-s' cargo check
RUSTFLAGS='-C link-arg=-s' cargo test
Build:
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Compute diff 📜
uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.rs
Cargo.toml
Cargo.lock
- name: Setup Rust 🧰
if: env.GIT_DIFF
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Build 🔨
if: env.GIT_DIFF
run: |
RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown --release