-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (45 loc) · 1.62 KB
/
ci.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
name: race-of-sloth-ci
# The ref given is fully-formed, meaning that for branches the format is refs/heads/<branch_name>, for pull requests it is refs/pull/<pr_number>/merge, and for tags it is refs/tags/<tag_name>
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
jobs:
ci:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- run: git config --global --add safe.directory "*"
- uses: technote-space/[email protected]
id: git-diff
with:
PATTERNS: |
**/**.rs
Cargo.lock
- uses: dsherret/rust-toolchain-file@v1
if: steps.git-diff.outputs.diff
- name: fmt
run: cargo fmt --all -- --check
if: steps.git-diff.outputs.diff
- name: install cargo-near
if: steps.git-diff.outputs.diff
run:
sudo apt update -y &&
sudo apt install -y pkg-config libusb-1.0-0-dev libftdi1-dev libudev-dev &&
cargo install cargo-near
- name: clippy
if: steps.git-diff.outputs.diff
run: |
cargo clippy --release -- -D warnings -A clippy::too_many_arguments
- name: build bot
if: steps.git-diff.outputs.diff
run: cargo build --release
- name: build contract
if: steps.git-diff.outputs.diff
run: cd contract && cargo near build