-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (46 loc) · 1.78 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
48
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 system deps
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
- name: install cargo-near
if: steps.git-diff.outputs.diff
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- 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