Skip to content

Commit

Permalink
217: cleanup github actions
Browse files Browse the repository at this point in the history
- adding support for code coverage analytics
- SDUtilityPoolTest.test_RequestWithdraw - cleanup test with fuzzer range issues
- adding manual workflow dispatch
  • Loading branch information
jac18281828 committed Apr 8, 2024
1 parent 441fb70 commit 5caad1d
Show file tree
Hide file tree
Showing 12 changed files with 1,549 additions and 295 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci-image.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Dev Image CI

on:
workflow_dispatch:
pull_request:
Expand All @@ -8,7 +7,6 @@ on:
push:
branches:
- "*"

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -21,12 +19,10 @@ jobs:
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and Push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: false
build-args: |
VERSION=latest
27 changes: 27 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Coverage
on: [workflow_dispatch, pull_request, push]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: npm install
run: |
npm ci --frozen-lockfile --production
- name: Run Forge coverage
run: |
forge coverage --report lcov
id: coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
25 changes: 8 additions & 17 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
name: Lint

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

permissions:
checks: write
contents: write

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
token: ${{ secrets.github_token }}

- name: Set up node
- name: Set up nodejs
uses: actions/setup-node@v1
with:
node-version: 18

- name: Install dependencies
run: npm install --frozen-lockfile

- name: Run linters
uses: wearerequired/[email protected]
with:
github_token: ${{ secrets.github_token }}
prettier: true
prettier_extensions: 'js,json,jsx,md,ts,tsx,yaml,yml,sol'
continue_on_error: false
- name: install dependencies (npm)
run: npm ci --frozen-lockfile
- name: Prettier
run: npm run prettier:check
- name: Solhint
run: npm run lint
4 changes: 0 additions & 4 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Slither Analysis

on:
push:
branches:
- main
pull_request:

jobs:
analyze:
runs-on: ubuntu-latest
Expand All @@ -20,15 +18,13 @@ jobs:
uses: actions/checkout@v2
with:
token: ${{ secrets.github_token }}

- name: Run Slither
uses: crytic/[email protected]
id: slither
with:
node-version: 16
sarif: results.sarif
fail-on: config

- if: failure()
uses: Ayrx/[email protected]
with:
Expand Down
23 changes: 9 additions & 14 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
name: Tests

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

permissions:
checks: write
contents: write

jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
token: ${{ secrets.github_token }}

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 16

node-version: 18
- name: Install dependencies
run: npm install --frozen-lockfile

- name: Compile
run: npx hardhat compile

- name: Run unit tests
run: npx hardhat node & npx hardhat test
run: npm ci --frozen-lockfile
- name: solidity unit tests
run: forge test -v
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ RUN chown -R foundry:foundry .
COPY --chown=foundry:foundry . .
ENV USER=foundry
USER foundry
ENV PATH=${PATH}:~/.cargo/bin
ENV PATH=${PATH}:~/.cargo/bin:/usr/local/go/bin

RUN python3 -m pip install slither-analyzer --break-system-packages

RUN npm ci
RUN yamlfmt -lint .github/workflows/*.yml

RUN npm ci --frozen-lockfile
RUN npm run prettier:check
# RUN slither .
# RUN npm run lint
RUN forge test -v
RUN forge coverage
RUN forge geiger --check contracts/*.sol contracts/*/*.sol
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

[![Test](https://github.com/stader-labs/ethx/actions/workflows/ci-image.yml/badge.svg)](https://github.com/stader-labs/ethx/actions/workflows/ci-image.yml)

# Overview

ETHx is a multi pool architecture for node operations, designed for decentralization, scalability, and resilience. This design is integral to our ability to democratize node operations and adapt to increasing demand.
Expand Down
Loading

0 comments on commit 5caad1d

Please sign in to comment.