Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running tests with native forge #1

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .dockerignore

This file was deleted.

15 changes: 5 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,13 @@ jobs:
with:
submodules: recursive

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

- name: "EOF run Forge build"
id: build-eof
run: make build-eof
run: forge build

- name: "EOF run Forge test"
id: test-eof
run: make test-eof

- name: "Legacy run Forge build"
id: build-legacy
run: make build-legacy

- name: "Legacy run Forge test"
id: test-legacy
run: make test-legacy
run: forge test
8 changes: 0 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "patches/solidity-legacy"]
path = patches/solidity-legacy
url = https://github.com/ipsilon/solidity.git
branch = eof-functions-rebased
[submodule "patches/solidity-eof"]
path = patches/solidity-eof
url = https://github.com/fgimenez/solidity.git
branch = eof-functions-rebased
42 changes: 4 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& \
update-ca-certificates

COPY .git /app/.git
COPY .gitmodules /app

WORKDIR /app

RUN git submodule init && git submodule update --recursive

WORKDIR /app/patches/solidity-eof
WORKDIR /app/solidity
RUN git clone https://github.com/ipsilon/solidity . && git checkout c49b88b

RUN mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-Wno-error=conversion" && \
make solc -j$(nproc)

WORKDIR /app/patches/solidity-legacy

RUN mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-Wno-error=conversion" && \
make solc -j$(nproc)

FROM ubuntu:jammy-20240212

# Copy the compiled solc binary to a standard location
COPY --from=solc-builder /app/patches/solidity-legacy/build/solc/solc /usr/local/bin/solc-legacy
COPY --from=solc-builder /app/patches/solidity-eof/build/solc/solc /usr/local/bin/solc-eof
RUN chmod +x /usr/local/bin/solc-legacy && chmod +x /usr/local/bin/solc-eof

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git && \
curl -L https://foundry.paradigm.xyz | bash && \
~/.foundry/bin/foundryup && \
cp ~/.foundry/bin/* /usr/local/bin
ENV PATH="${HOME}/.foundry/bin:${PATH}"

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

EXPOSE 8545

ENTRYPOINT ["/entrypoint.sh"]
WORKDIR /app/root
ENTRYPOINT ["/app/solidity/build/solc/solc"]
42 changes: 0 additions & 42 deletions Makefile

This file was deleted.

39 changes: 0 additions & 39 deletions entrypoint.sh

This file was deleted.

3 changes: 3 additions & 0 deletions eof-solc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

docker run -i -v $(pwd):/app/root eof-solc "$@"
11 changes: 4 additions & 7 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
src = "src"
out = "out"
libs = ["lib"]
evm_version = "Cancun"
optimizer = true
via_ir = true
prague = true
cbor_metadata = false
bytecode_hash = "none"

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
solc = "./eof-solc"
via_ir = true
evm_version = "prague"
eof_version = 1
1 change: 0 additions & 1 deletion patches/solidity-eof
Submodule solidity-eof deleted from 072602
1 change: 0 additions & 1 deletion patches/solidity-legacy
Submodule solidity-legacy deleted from 921422
Loading