Skip to content

Commit

Permalink
chore: update submodules and ci workflows (#21)
Browse files Browse the repository at this point in the history
* chore: bump ci actions

* fix: workflow trigger rules

* fix: foundry.toml

* fix: foundry import

* test: set evm_version

* test: evm_version set to `paris`

* v0.0.0

* test: set explicitly version to 0.8.19

* chore: add `ffi` option in config.toml

* ci: nit

* chore: forge update

* chore: change solidity versions to `^0.8.0` to be compatible with lib dependencies and solve build issues

* chore: remove `evm_version` in config.toml

* ci: update ci

* chore: migrate to `pnpm` and fix lint issues

* fix: lint ci

* fix: exploit ci
  • Loading branch information
leovct authored Jan 26, 2024
1 parent 8294bf1 commit 88824d7
Show file tree
Hide file tree
Showing 24 changed files with 646 additions and 737 deletions.
45 changes: 19 additions & 26 deletions .github/workflows/exploit.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
name: exploit

on:
push:
paths:
# Github workflow
- '.github/workflows/test.yaml'
# Libraries and configuration files
- 'lib/**/*'
- '.gitmodules'
- 'foundry.toml'
# Contracts and tests
- 'src/**/*.sol'
- 'test/**/*.t.sol'
on: push

env:
PNPM_VERSION: '8'
NODE_VERSION: '20.9'
FOUNDRY_PROFILE: ci

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

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Exploit CTFs
exploit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand All @@ -42,13 +33,15 @@ jobs:
with:
version: nightly

- name: Run forge build
- name: Display tool versions
run: |
forge --version
forge build --sizes
huffc --version
- name: Build contracts
run: pnpm run build
id: build

- name: Run forge tests (exploits)
run: |
forge test --ffi -vvv
- name: Run exploits
run: pnpm run exploits
id: test
44 changes: 19 additions & 25 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
name: lint

on:
push:
paths:
# Contracts and tests
- 'src/**/*.sol'
- 'test/**/*.t.sol'
# Documentation
- README.md
on: push

env:
PNPM_VERSION: '8'
NODE_VERSION: '20.9'

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

jobs:
check:
strategy:
fail-fast: true

name: Lint
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-node@v3
- uses: pnpm/action-setup@v2
with:
node-version: 18
version: ${{ env.PNPM_VERSION }}

- name: Install npm dependencies
run: npm ci
id: install
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'

- name: Run lint on Solidity code
run: npx prettier --check 'src/**/*.sol' 'test/**/*.sol'
id: solidity-lint
- name: Install dependencies
run: pnpm install
id: install

- name: Run lint on README.md
run: npx markdown-table-formatter --check README.md
id: readme-lint
- name: Run linter
run: pnpm run check
id: lint
43 changes: 0 additions & 43 deletions Makefile

This file was deleted.

2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ libs = ["lib"]
remappings = [
'@forge-std/=lib/forge-std/src/',
'@openzeppelin/=lib/openzeppelin-contracts/contracts',
'@foundry-huff/=lib/foundry-huff/src',
]
ffi = true

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
Loading

0 comments on commit 88824d7

Please sign in to comment.