diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3dd0852..4ff03cf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,40 +1,40 @@ -name: Node.js CI +# name: Ethernaut cli CI -on: - push: - branches: [main] - pull_request: - branches: [main] +# on: +# push: +# branches: [main] +# pull_request: +# branches: [main] -jobs: - build: - runs-on: ubuntu-latest - env: - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} +# jobs: +# build: +# runs-on: ubuntu-latest +# env: +# ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} +# ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} +# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - strategy: - matrix: - node-version: [20.x] +# strategy: +# matrix: +# node-version: [20.x] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - 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: cd packages/common && npm t - - run: cd packages/ethernaut-toolbox && npm t - - run: cd packages/ethernaut-ui && npm t - - run: cd packages/ethernaut-interact && npm t - - run: cd packages/ethernaut-challenges && npm t - - run: cd packages/ethernaut-ai && npm t - - run: cd packages/ethernaut-cli && npm t +# steps: +# - uses: actions/checkout@v2 +# - name: Use Node.js ${{ matrix.node-version }} +# uses: actions/setup-node@v2 +# with: +# node-version: ${{ matrix.node-version }} +# - 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: cd packages/common && npm t +# - run: cd packages/ethernaut-toolbox && npm t +# - run: cd packages/ethernaut-ui && npm t +# - run: cd packages/ethernaut-interact && npm t +# - run: cd packages/ethernaut-challenges && npm t +# - run: cd packages/ethernaut-ai && npm t +# - run: cd packages/ethernaut-cli && npm t diff --git a/.github/workflows/ci1.yml b/.github/workflows/ci1.yml new file mode 100644 index 00000000..e741fa90 --- /dev/null +++ b/.github/workflows/ci1.yml @@ -0,0 +1,66 @@ +name: Ethernaut CLI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + +jobs: + prepare: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + cache: 'npm' + + - name: Install root dependencies + run: npm ci + + # Assuming your monorepo structure has a packages directory + # Adjust paths as necessary for your monorepo structure + - name: Cache node_modules for packages + uses: actions/cache@v3 + with: + path: | + ./node_modules + ./packages/*/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + test-common: + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Install + run: npm ci + working-directory: ./packages/common + + - name: Build + run: npm run build + working-directory: ./packages/common + + - name: Compile + run: npm run compile + working-directory: ./packages/common + + - name: Test + run: npm t + working-directory: ./packages/common