Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
eternauta1337 committed Feb 24, 2024
1 parent a9d27b3 commit 11db80c
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 36 deletions.
72 changes: 36 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
66 changes: 66 additions & 0 deletions .github/workflows/ci1.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 11db80c

Please sign in to comment.