forked from catalystdao/generalised-relayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Add DockerFile for github actions
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Dockerfile.tests located in deployments/ci | ||
|
||
# Use the official Node.js image as a base | ||
FROM node:21.7.1 | ||
|
||
# Install curl and other necessary tools | ||
RUN apt-get update && apt-get install -y curl sudo | ||
|
||
# Set the working directory inside the Docker container | ||
WORKDIR /usr/src/app | ||
|
||
# Copy the ABIs directory first to ensure it's available during installation | ||
COPY ./abis ./abis | ||
|
||
# Copy package.json and pnpm-lock.yaml for dependency installation | ||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
# Install pnpm globally | ||
RUN npm install -g pnpm | ||
|
||
# Install app dependencies (including running the postinstall script) | ||
RUN pnpm install --no-frozen-lockfile | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Ensure the install_foundry.sh script is executable | ||
RUN chmod +x ./deployments/ci/install_foundry.sh | ||
|
||
# Run the Foundry and anvil installation script | ||
RUN ./deployments/ci/install_foundry.sh | ||
|
||
# Add Foundry binaries to the PATH | ||
ENV PATH="/root/.foundry/bin:$PATH" | ||
|
||
# Verify that `anvil` is correctly installed and accessible | ||
RUN anvil --version | ||
|
||
# Run any additional setup scripts if needed | ||
RUN pnpm before-test # This might be where Typechain commands are executed | ||
|
||
# Default command to run the tests | ||
CMD ["pnpm", "test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# Install Foundry and anvil | ||
echo "Installing Foundry and anvil" | ||
curl -L https://foundry.paradigm.xyz | bash | ||
|
||
echo "Reloading the shell configuration to update PATH" | ||
if [ -f "$HOME/.bashrc" ]; then | ||
. "$HOME/.bashrc" | ||
elif [ -f "$HOME/.profile" ]; then | ||
. "$HOME/.profile" | ||
elif [ -f "$HOME/.zshrc" ]; then | ||
. "$HOME/.zshrc" | ||
fi | ||
|
||
echo "Verifying Foundry installation" | ||
if command -v foundryup >/dev/null 2>&1; then | ||
echo "Foundry installed successfully!" | ||
source /home/runner/.bashrc | ||
foundryup --version | ||
foundryup | ||
else | ||
echo "Foundry installation failed. foundryup command not found." | ||
exit 1 | ||
fi |