Skip to content

Commit

Permalink
Initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
gndelia committed May 6, 2024
1 parent d60cca3 commit a62b013
Show file tree
Hide file tree
Showing 18 changed files with 12,910 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Setup Environment
description: Does minimal setup of environment for a job

runs:
using: composite
steps:
- name: Add extra required branches
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'main' }}
run: git fetch origin main:main ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
shell: bash

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Restore cache
id: npm-cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
shell: bash
45 changes: 45 additions & 0 deletions .github/workflows/CI_Checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Checks on CI

# Will limit one workflow per branch and one per pull_request at the same time
# and cancel if a new one appears.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

on:
pull_request:
push:

jobs:
code_checks:
name: Code Styling check
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Setup env
uses: ./.github/actions/setup-env

- name: Check formatting
run: npm run format:check

- name: Check linting
run: npm run lint
tests:
name: Tests checks
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Setup env
uses: ./.github/actions/setup-env

- name: Run test
run: npm run test
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.eslintcache
.nyc_output
coverage
dist
lerna-debug.log
node_modules
tsconfig.tsbuildinfo
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# eth-packages

A collection of small and useful packages eth-related we use across many of our solutions

## Packages

- [`eth-rpc-cache`](./packages/eth-rpc-cache): A simple cache for Ethereum JSON-RPC requests
5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"packages": ["packages/*"],
"version": "independent"
}
Loading

0 comments on commit a62b013

Please sign in to comment.