-
Notifications
You must be signed in to change notification settings - Fork 15
64 lines (49 loc) · 1.54 KB
/
build-fmt.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
name: Build and Format
on: [push]
jobs:
build-and-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup show
- name: Install rustfmt and clippy
run: |
rustup component add rustfmt
rustup component add clippy
- uses: Swatinem/rust-cache@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-0079a1146b79a4aeda58b0258215bedb1f92700b
- name: Build contracts
working-directory: packages/contracts
run: yarn build
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Build and check for warnings
env:
RUSTFLAGS: "-D warnings"
run: cargo build --release
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy -- -D warnings