From 37dfc1a74858f63832e6a91eedfdf174a3d37804 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Sat, 24 Feb 2024 08:30:32 -0300 Subject: [PATCH] Tweak ci --- .github/workflows/ci.yml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a89d72c7..a6851c3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,25 +10,28 @@ jobs: setup: runs-on: ubuntu-latest outputs: - cache-key: ${{ steps.cache-keys.outputs.key }} - env: - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - + cache-key: ${{ steps.cache.outputs.key }} steps: - uses: actions/checkout@v2 - - name: Use Node.js 20.x + - name: Setup Node.js uses: actions/setup-node@v2 with: node-version: 20.x - - run: npm ci + cache: 'npm' + - name: Install Dependencies + run: npm ci - run: npm run build --if-present - run: npm run compile --if-present - name: Start local chain - run: | - npm run chain & - sleep 10 + run: npm run chain & sleep 10 + - name: Cache node modules + id: cache + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- test: needs: setup @@ -45,14 +48,18 @@ jobs: ethernaut-toolbox, ethernaut-ui, ] - fail-fast: false # Keep running other jobs even if one fails + fail-fast: false steps: - uses: actions/checkout@v2 - - name: Use Node.js 20.x + - name: Setup Node.js uses: actions/setup-node@v2 with: node-version: 20.x cache: 'npm' - cache-dependency-path: '**/package-lock.json' + - name: Restore Dependencies from Cache + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ needs.setup.outputs.cache-key }} - name: Test ${{ matrix.package }} run: cd packages/${{ matrix.package }} && npm t