From 77bb9441c186efa15aca6c6c560061ca38e7f346 Mon Sep 17 00:00:00 2001 From: Diego Date: Tue, 5 Nov 2024 17:33:53 -0500 Subject: [PATCH] Update cannon.yml --- .github/workflows/cannon.yml | 51 +++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cannon.yml b/.github/workflows/cannon.yml index 29d761248a0ee..549c7c92590ce 100644 --- a/.github/workflows/cannon.yml +++ b/.github/workflows/cannon.yml @@ -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: | @@ -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