Skip to content

Commit

Permalink
Merge pull request #1 from primevprotocol/enable-lint-cache
Browse files Browse the repository at this point in the history
chore: enable golanglintci cache
  • Loading branch information
mrekucci authored Apr 7, 2024
2 parents 516cfd0 + d9b685a commit 7a1fe14
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 85 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.22
cache: true
check-latest: true
cache-dependency-path: go.work.sum

# TODO(mrekucci): Re-enable when the repo is finalized.
# - name: GHCR Docker Login
Expand Down
99 changes: 49 additions & 50 deletions .github/workflows/mev-commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,55 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive

- 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
check-latest: true
cache-dependency-path: go.work.sum

- name: Workspace Modules
run: |
echo $(go list -f '{{.Dir}}' -m)
echo "GO_LINT_DIRS=$(go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | 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 }}
only-new-issues: true
skip-cache: true

- 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
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive

- 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
check-latest: true
cache-dependency-path: go.work.sum

- name: Workspace Modules
run: |
echo $(go list -f '{{.Dir}}' -m)
echo "GO_LINT_DIRS=$(go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | 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: --timeout 15m --verbose ${{ env.GO_LINT_DIRS }}
skip-cache: true # TODO(mrekucci): remove when the following issue is solved https://github.com/golangci/golangci-lint-action/issues/135#issuecomment-2039548548

- 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
Expand Down
34 changes: 0 additions & 34 deletions .golangci.yml

This file was deleted.

0 comments on commit 7a1fe14

Please sign in to comment.