-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (87 loc) · 2.5 KB
/
main.yaml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: "Checks"
on:
pull_request:
push:
branches: main
jobs:
build:
name: "Build FNS actor"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '16.13.0'
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install yarn
run: npm install -g yarn
- name: Install deps
run: make deps
- name: Build WASM file
run: make build
- uses: actions/upload-artifact@v3
with:
name: fil-fns-actor-previous
path: ./build/fil-fns-actor.wasm
diff:
name: "Check diff"
needs: ["build"]
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: fil-fns-actor-previous
path: ./fil-fns-actor
- name: Download artifact from previous build
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: main.yaml
check_artifacts: false
branch: main
continue-on-error: true
- name: Compared file size
if: success()
run: |
ls -l
FILE_PREV_SIZE=$(stat -c%s fil-fns-actor-previous/fil-fns-actor.wasm)
FILE_SIZE=$(stat -c%s fil-fns-actor/fil-fns-actor.wasm)
echo "delta_size=$(expr $FILE_SIZE - $FILE_PREV_SIZE)" >> $GITHUB_ENV
- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
if: success()
with:
message: |
Size difference : ${{env.delta_size}} bytes
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
name: "Test FNS actor"
runs-on: ubuntu-latest
needs: ["build"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-03-31
override: true
- uses: actions/download-artifact@v3
with:
name: fil-fns-actor-previous
path: ./fil-fns-actor
- name: Test WASM file
run: |
mkdir -p build
mv fil-fns-actor/fil-fns-actor.wasm build/fil-fns-actor.wasm
rustup target add wasm32-unknown-unknown
make test