-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (69 loc) · 2.5 KB
/
Copy pathpr.yml
File metadata and controls
72 lines (69 loc) · 2.5 KB
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
name: PR
on:
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-install-project
npm ci
- name: Install Ape dependencies
run: uv run ape pm install
- name: Ruff
run: uv run ruff check
- name: Prettier
run: npx prettier --check --plugin=prettier-plugin-solidity "contracts/**/*.sol" "interfaces/**/*.sol"
unit-test:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Set up Foundry
uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1.9.1
with:
version: stable
- name: Install dependencies
run: |
uv sync --frozen --no-install-project
npm ci
- name: Install Solidity compiler
run: |
set -euo pipefail
solcx_dir="$HOME/.solcx"
temp_dir="$(mktemp -d)"
compiler_path="$temp_dir/solc-static-linux"
compiler_url="https://github.com/ethereum/solidity/releases/download/v0.8.34/solc-static-linux"
compiler_sha256="d40adc6f9fdbb22a97d32a02fa05688bf2ee7886affc48c9851b0afd4a726b39"
mkdir -p "$solcx_dir"
curl -fsSL "$compiler_url" -o "$compiler_path"
echo "$compiler_sha256 $compiler_path" | sha256sum --check --status
install -m 0755 "$compiler_path" "$solcx_dir/solc-v0.8.34"
- name: Install Ape dependencies
run: uv run ape pm install
- name: Compile contracts
run: |
uv run ape compile
uv run python tools/json_filter.py
- name: Run tests
run: uv run ape test --network ethereum:local:foundry tests/