Skip to content

Commit

Permalink
feat(foundry): update from upstream (#187)
Browse files Browse the repository at this point in the history
Signed-off-by: Danil <[email protected]>
Co-authored-by: Resende <[email protected]>
Co-authored-by: Léo Vincent <[email protected]>
Co-authored-by: evalir <[email protected]>
Co-authored-by: tsite <[email protected]>
Co-authored-by: Daniel Viau <[email protected]>
Co-authored-by: christn <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Nicolas Gotchac <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: DaniPopes <[email protected]>
Co-authored-by: Markus Osterlund / robriks <[email protected]>
Co-authored-by: DaniPopes <[email protected]>
Co-authored-by: Alejandro Munoz <[email protected]>
Co-authored-by: Alejandro Muñoz-McDonald <[email protected]>
Co-authored-by: clabby <[email protected]>
Co-authored-by: mattsse <[email protected]>
Co-authored-by: Arsenii Kulikov <[email protected]>
Co-authored-by: Arsenii Kulikov <[email protected]>
Co-authored-by: ts <[email protected]>
Co-authored-by: James Wenzel <[email protected]>
Co-authored-by: James Wenzel <[email protected]>
Co-authored-by: Vladimir <[email protected]>
Co-authored-by: Inphi <[email protected]>
Co-authored-by: sakotn <[email protected]>
Co-authored-by: auebasota1337 <[email protected]>
Co-authored-by: teddav <[email protected]>
Co-authored-by: danilo neves cruz <[email protected]>
Co-authored-by: Arshan Khanifar <[email protected]>
Co-authored-by: Arsenii Kulikov <[email protected]>
Co-authored-by: Qiwei Yang <[email protected]>
Co-authored-by: Bakuchi <[email protected]>
Co-authored-by: DoTheBestToGetTheBest <[email protected]>
Co-authored-by: refcell <[email protected]>
Co-authored-by: Tudor <[email protected]>
Co-authored-by: Luke Parker <[email protected]>
Co-authored-by: Miguel Palhas <[email protected]>
Co-authored-by: Michael de Hoog <[email protected]>
Co-authored-by: Anika Raghuvanshi <[email protected]>
Co-authored-by: anikaraghu <[email protected]>
Co-authored-by: Valentin B <[email protected]>
Co-authored-by: Rim Rakhimov <[email protected]>
Co-authored-by: albertov19 <[email protected]>
Co-authored-by: Daniel Helm <[email protected]>
Co-authored-by: 0xtekgrinder <[email protected]>
Co-authored-by: greged93 <[email protected]>
Co-authored-by: Akaonetwo <[email protected]>
Co-authored-by: Anıl <[email protected]>
Co-authored-by: 0xbasar <[email protected]>
Co-authored-by: codeesura <[email protected]>
Co-authored-by: 0xMemoryGrinder <[email protected]>
Co-authored-by: Cheng-Kang Chen <[email protected]>
Co-authored-by: Dustin Brickwood <[email protected]>
Co-authored-by: Nisheeth Barthwal <[email protected]>
Co-authored-by: Nisheeth Barthwal <[email protected]>
Co-authored-by: Aleksey Bykhun <[email protected]>
  • Loading branch information
Show file tree
Hide file tree
Showing 779 changed files with 34,018 additions and 78,286 deletions.
19 changes: 6 additions & 13 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
[alias]
cheats = "test -p foundry-cheatcodes --features schema tests::"
cheats = "test -p foundry-cheatcodes-spec --features schema tests::"
test-debugger = "test -p forge --test cli manual_debug_setup -- --include-ignored --nocapture"

# Increase the stack size to 10MB for Windows targets, which is in line with Linux
# (whereas default for Windows is 1MB).
[target.x86_64-pc-windows-msvc]
rustflags = [
# Increases the stack size to 10MB, which is
# in line with Linux (whereas default for Windows is 1MB)
"-C",
"link-arg=/STACK:10000000",
]
rustflags = ["-Clink-arg=/STACK:10000000"]

[target.i686-pc-windows-msvc]
rustflags = [
# Increases the stack size to 10MB, which is
# in line with Linux (whereas default for Windows is 1MB)
"-C",
"link-arg=/STACK:10000000",
]
rustflags = ["-Clink-arg=/STACK:10000000"]
11 changes: 11 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[profile.default]
retries = { backoff = "exponential", count = 2, delay = "2s", jitter = true }
slow-timeout = { period = "1m", terminate-after = 3 }

[[profile.default.overrides]]
filter = "test(/ext_integration|can_test_forge_std/)"
slow-timeout = { period = "5m", terminate-after = 4 }

[profile.heavy]
retries = 1
slow-timeout = { period = "120m", terminate-after = 1}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
**/*.sol linguist-language=Solidity

crates/abi/src/bindings/*.rs linguist-generated
crates/cheatcodes/assets/*.json linguist-generated
testdata/cheats/Vm.sol linguist-generated
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* @danipopes @evalir @mattsse

crates/anvil/ @evalir @mattsse
crates/evm/coverage/ @evalir @onbjerg
crates/fmt/ @rkrasiuk
crates/macros/impls/ @danipopes
91 changes: 49 additions & 42 deletions .github/scripts/matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,105 +4,114 @@
import os


# A runner target
class Target:
# GitHub runner OS
os_id: str
# Rust target triple
target: str
# SVM Solc target
svm_target_platform: str

def __init__(self, os_id: str, target: str):
def __init__(self, os_id: str, target: str, svm_target_platform: str):
self.os_id = os_id
self.target = target
self.svm_target_platform = svm_target_platform


# A single test suite to run.
class Case:
# Name of the test suite.
name: str
# Nextest filter expression.
filter: str
# Number of partitions to split the test suite into.
n_partitions: int
xplatform: bool
# Whether to run on non-Linux platforms for PRs. All platforms and tests are run on pushes.
pr_cross_platform: bool

def __init__(self, name: str, filter: str, n_partitions: int, xplatform: bool):
def __init__(
self, name: str, filter: str, n_partitions: int, pr_cross_platform: bool
):
self.name = name
self.filter = filter
self.n_partitions = n_partitions
self.xplatform = xplatform
self.pr_cross_platform = pr_cross_platform


# GHA matrix entry
class Expanded:
name: str
os: str
target: str
name: str
svm_target_platform: str
flags: str
partition: int

def __init__(self, os: str, target: str, name: str, flags: str, partition: int):
def __init__(
self,
name: str,
os: str,
target: str,
svm_target_platform: str,
flags: str,
partition: int,
):
self.name = name
self.os = os
self.target = target
self.name = name
self.svm_target_platform = svm_target_platform
self.flags = flags
self.partition = partition


default_target = Target("ubuntu-latest", "x86_64-unknown-linux-gnu")
if os.environ.get("EVENT_NAME") == "pull_request":
targets = [default_target]
else:
targets = [
default_target,
Target("ubuntu-latest", "aarch64-unknown-linux-gnu"),
Target("macos-latest", "x86_64-apple-darwin"),
# Disabled since the test binary will be built for M1/M2, but there are no
# GitHub runners capable of executing those binaries.
# Target("macos-latest", "aarch64-apple-darwin"),
Target("windows-latest", "x86_64-pc-windows-msvc"),
]
is_pr = os.environ.get("EVENT_NAME") == "pull_request"
t_linux_x86 = Target("ubuntu-latest", "x86_64-unknown-linux-gnu", "linux-amd64")
# TODO: Figure out how to make this work
# t_linux_arm = Target("ubuntu-latest", "aarch64-unknown-linux-gnu", "linux-aarch64")
t_macos = Target("macos-latest", "x86_64-apple-darwin", "macosx-amd64")
t_windows = Target("windows-latest", "x86_64-pc-windows-msvc", "windows-amd64")
targets = [t_linux_x86, t_windows] if is_pr else [t_linux_x86, t_macos, t_windows]

config = [
Case(
name="unit",
filter="kind(lib) | kind(bench) | kind(proc-macro)",
n_partitions=1,
xplatform=True,
pr_cross_platform=True,
),
Case(
name="integration",
filter="kind(test) & !test(/issue|forge_std|ext_integration/)",
n_partitions=3,
xplatform=True,
pr_cross_platform=True,
),
Case(
name="integration/issue-repros",
name="integration / issue-repros",
filter="package(=forge) & test(~issue)",
n_partitions=2,
xplatform=False,
pr_cross_platform=False,
),
Case(
name="integration/forge-std",
name="integration / forge-std",
filter="package(=forge) & test(~forge_std)",
n_partitions=1,
xplatform=False,
pr_cross_platform=False,
),
Case(
name="integration/external",
name="integration / external",
filter="package(=forge) & test(~ext_integration)",
n_partitions=2,
xplatform=False,
pr_cross_platform=False,
),
]


def build_matrix():
expanded = []
for target in targets:
expanded.append({"os": target.os_id, "target": target.target})
print_json({"include": expanded})


def test_matrix():
def main():
expanded = []
for target in targets:
for case in config:
if not case.xplatform and target != default_target:
if is_pr and (not case.pr_cross_platform and target != t_linux_x86):
continue

for partition in range(1, case.n_partitions + 1):
Expand All @@ -119,9 +128,10 @@ def test_matrix():
name += os_str

obj = Expanded(
name=name,
os=target.os_id,
target=target.target,
name=name,
svm_target_platform=target.svm_target_platform,
flags=flags,
partition=partition,
)
Expand All @@ -135,7 +145,4 @@ def print_json(obj):


if __name__ == "__main__":
if int(os.environ.get("TEST", "0")) == 0:
build_matrix()
else:
test_matrix()
main()
2 changes: 1 addition & 1 deletion .github/workflows/deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check all
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Automatically run `cargo update` periodically

name: Update Dependencies
name: dependencies

on:
schedule:
Expand Down Expand Up @@ -32,10 +32,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2023-07-23
toolchain: nightly-2023-09-21

- name: cargo update
# Remove first line that always just says "Updating crates.io index"
Expand Down
Loading

0 comments on commit 31f2f02

Please sign in to comment.