-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (62 loc) · 1.91 KB
/
go.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
73
74
name: go-fvm-sdk
on:
pull_request:
branches:
- '**'
env:
RUSTFLAGS: -Dwarnings
jobs:
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: dependencies
run: sudo apt-get -o Acquire::Retries=3 update && sudo apt-get -o Acquire::Retries=3 install make git mesa-opencl-icd ocl-icd-opencl-dev wget -y && sudo apt upgrade -y
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.3
- name: setup rust
uses: actions-rs/toolchain@v1
with:
target: wasm32-unknown-unknown
override: true
components: rustfmt, clippy
- name: setup build cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: install tinygo
run: |
wget https://github.com/tinygo-org/tinygo/releases/download/v0.27.0/tinygo_0.27.0_amd64.deb
sudo dpkg -i tinygo_0.27.0_amd64.deb
rm tinygo_0.27.0_amd64.deb
- name: Build
run: |
make build
make build-client-example
make install
- name: patch
run: |
sudo fvm_go_sdk patch
- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.1
golangci-lint run ./... --timeout 10m
- name: gen-check
run: |
export PATH=$PATH:/usr/local/tinygo/bin
make code-gen
git status --porcelain
test -z "$(git status --porcelain)"
- name: Test
run: |
export PATH=$PATH:/usr/local/tinygo/bin
make test