fix: mev-commit-cli.sh start minimal #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: mev-commit-ci | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
go-modules: | |
name: Test and Build Go Modules | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
**/go.work.sum | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.work.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
cache: true | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Workspace Modules | |
run: | | |
echo $(go list -f '{{.Dir}}' -m) | |
echo "GO_LINT_DIRS=$(go list -f '{{.Dir}}/...' -m | tr '\n' ' ')" >> $GITHUB_ENV | |
- name: Run Gofmt | |
run: go list -f '{{.Dir}}' -m | xargs gofmt -d -e -l | |
- name: Run Tidy | |
run: go list -f '{{.Dir}}' -m | xargs -L1 go mod tidy -C | |
- name: Run Sync | |
run: go work sync | |
- name: Run Lint | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
version: v1.57.2 | |
args: --verbose ${{ env.GO_LINT_DIRS }} | |
- name: Run Build | |
run: go list -f '{{.Dir}}/...' -m | xargs go build | |
# TODO(mrekucci): Re-enable /external/geth module when tests are passing. | |
- name: Run Test | |
run: go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | xargs go test -short -race | |
foundry: | |
name: Foundry Checks and Reports | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./contracts | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Run Tests | |
run: forge test -vvv --via-ir | |
- name: Run Snapshot | |
run: forge snapshot --via-ir | |
- name: Run Coverage | |
run: forge coverage --ir-minimum | |
contracts: | |
name: Test and Build Contracts Scripts | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./contracts | |
strategy: | |
matrix: | |
node-version: [ 18.x, 20.x ] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache-dependency-path: ./contracts/package-lock.json | |
cache: npm | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Install Hardhat | |
run: npm install -g hardhat | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build --if-present |