Skip to content

Commit

Permalink
add CI actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed May 21, 2024
1 parent 93c9e44 commit f94b777
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup

runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
id: cache
with:
path: '**/node_modules'
key: npm-v3-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
61 changes: 61 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: checks

on:
push:
branches:
- master
pull_request: {}
workflow_dispatch: {}

concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true

env:
NODE_OPTIONS: --max_old_space_size=8192

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup
- run: npm run lint

tests:
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
# Needed for "eth-gas-reporter" to produce a "gasReporterOutput.json" as documented in
# https://github.com/cgewecke/eth-gas-reporter/blob/v0.2.27/docs/gasReporterOutput.md
CI: true
GAS: true
steps:
- uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests and generate gas report
run: npm run test

tests-foundry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: forge test -vv

codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run CodeSpell
uses: codespell-project/actions-codespell@v2.0
with:
check_hidden: true
check_filenames: true
skip: package-lock.json,*.pdf

0 comments on commit f94b777

Please sign in to comment.