-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (53 loc) · 1.76 KB
/
linters-cargo.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
---
name: Task - Linters Cargo
on:
workflow_dispatch:
workflow_call:
jobs:
cargo-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key
- run: rustup show
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install Ganache
run: |
npm install -g [email protected]
ganache --version
- name: Install Solc
run: |
pip install solc-select
solc-select install 0.8.19
solc-select use 0.8.19
solc --version
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# ---------------------------------------------------
# workaround : https://github.com/asdf-vm/actions/issues/562
# asdf installation
- name: Detect ASDF .tool-versions file in repo
shell: bash
id: detect_tool_versions_file
run: |
if [ -s .tool-versions ]; then
echo "exists=1" >> $GITHUB_OUTPUT
fi
- name: ASDF install tools
if: ${{ steps.detect_tool_versions_file.outputs.exists == '1' }}
uses: asdf-vm/actions/install@6a442392015fbbdd8b48696d41e0051b2698b2e4
# ---------------------------------------------------
- uses: Swatinem/rust-cache@v2
- name: Format and clippy
run: |
git submodule update --init --recursive
make artifacts-linux
cargo fmt -- --check
cargo clippy --no-deps -- -D warnings
cargo clippy --tests --no-deps -- -D warnings