Skip to content

Commit

Permalink
Merge pull request #86 from Raiden1411/anvil_tests
Browse files Browse the repository at this point in the history
tests: update client tests to re-use anvil
  • Loading branch information
Raiden1411 authored Aug 13, 2024
2 parents 2862fc6 + 5155ba9 commit b958525
Show file tree
Hide file tree
Showing 20 changed files with 1,151 additions and 1,146 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ jobs:
with:
version: master

- name: Install Anvil
uses: foundry-rs/foundry-toolchain@v1

- name: Run Anvil
run: anvil --fork-url $ANVIL_FORK_URL --fork-block-number 19062632 --ipc --port 6969 &
env:
ANVIL_FORK_URL: ${{ secrets.ANVIL_FORK_URL }}

- name: Run Anvil OP Sepolia
run: anvil --fork-url $ANVIL_FORK_URL_OP_SEPOLIA --port 6970 &
env:
ANVIL_FORK_URL_OP_SEPOLIA: ${{ secrets.ANVIL_FORK_URL_OP_SEPOLIA }}

- name: Run Anvil Sepolia
run: anvil --fork-url $ANVIL_FORK_URL_SEPOLIA --port 6971 &
env:
ANVIL_FORK_URL_SEPOLIA: ${{ secrets.ANVIL_FORK_URL_SEPOLIA }}

- name: Get Zig version
id: zig_version
run: echo "zig_version=$(zig version)" >> $GITHUB_OUTPUT
Expand Down
40 changes: 1 addition & 39 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const mod = b.addModule("zabi", .{ .root_source_file = b.path("src/root.zig"), .link_libc = true });
const mod = b.addModule("zabi", .{ .root_source_file = b.path("src/root.zig") });

addDependencies(b, mod, target, optimize);

Expand All @@ -33,44 +33,6 @@ pub fn build(b: *std.Build) void {
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_lib_unit_tests.step);

// Creates and runs the wallet client test runner.
{
const wallet = b.addExecutable(.{
.name = "wallet_test",
.root_source_file = b.path("src/wallet_test.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
});
addDependencies(b, &wallet.root_module, target, optimize);

var wallet_run = b.addRunArtifact(wallet);
wallet_run.has_side_effects = true;

if (b.args) |args| wallet_run.addArgs(args);

const wallet_step = b.step("wallet_test", "Run the wallet client tests");
wallet_step.dependOn(&wallet_run.step);
}
// Creates and runs the rpc client http/s test runner.
{
const http = b.addExecutable(.{
.name = "rpc_test",
.root_source_file = b.path("src/rpc_test.zig"),
.target = target,
.optimize = optimize,
});
addDependencies(b, &http.root_module, target, optimize);

var http_run = b.addRunArtifact(http);
http_run.has_side_effects = true;

if (b.args) |args| http_run.addArgs(args);

const http_step = b.step("rpc_test", "Run the http client tests");
http_step.dependOn(&http_run.step);
}

// Build and run the http server if `zig build server` was ran
buildHttpServer(b, target, optimize);

Expand Down
Loading

0 comments on commit b958525

Please sign in to comment.