Skip to content

Commit

Permalink
Update cannon.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferret-san committed Nov 5, 2024
1 parent 73790b1 commit 77bb944
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions .github/workflows/cannon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ jobs:
steps:
- uses: actions/checkout@v4

# Debug step to check directory structure
- name: Debug directory structure
run: |
echo "Current directory: $(pwd)"
echo "Directory contents:"
ls -la
echo "Checking for packages directory:"
ls -la packages || echo "No packages directory"
# Install just command
- name: Install just
run: |
Expand All @@ -29,28 +38,34 @@ jobs:
with:
node-version: "18"

# Setup npm cache
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: |
~/.npm
packages/contracts-bedrock/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('packages/contracts-bedrock/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
# Install dependencies in the correct directory
- name: Install npm dependencies
working-directory: packages/contracts-bedrock
run: |
# First install to ensure package-lock.json exists
npm install
# Then run npm ci for consistent installs
if [ -f "package-lock.json" ]; then
npm ci
if [ ! -d "packages/contracts-bedrock" ]; then
echo "contracts-bedrock directory not found. Creating it..."
mkdir -p packages/contracts-bedrock
fi
cd packages/contracts-bedrock
# Initialize package.json if it doesn't exist
if [ ! -f "package.json" ]; then
echo "Creating package.json..."
echo '{
"name": "contracts-bedrock",
"version": "1.0.0",
"private": true,
"description": "Optimism Bedrock smart contracts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
}
}' > package.json
fi
# List contents after setup
echo "Directory contents after setup:"
ls -la
npm install
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

Expand Down

0 comments on commit 77bb944

Please sign in to comment.