Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial setup + first package #1

Merged
merged 4 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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