Skip to content

Commit e3b138a

Browse files
stdevMackhalifaa55
andauthored
Remove mockgen generation while cloning repo (#448)
* fix: include mocks on sourcecode, so no need for make generate each time * feat: check on each pull request that there is nothing to generate * docs: update changelog --------- Co-authored-by: Haneen Hany <124837763+khalifaa55@users.noreply.github.com>
1 parent cb6e42e commit e3b138a

File tree

7 files changed

+18579
-8
lines changed

7 files changed

+18579
-8
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Go Code Generation Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
generate:
11+
name: Check Code Generation
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.22'
22+
23+
- name: Set up Go bin in PATH
24+
run: echo "${HOME}/go/bin" >> $GITHUB_PATH
25+
26+
- name: Install Dependencies and Tools
27+
run: |
28+
make install-deps install-abigen install-mockgen
29+
30+
- name: Generate Code
31+
run: make generate
32+
33+
- name: Check for Uncommitted Changes
34+
run: |
35+
if [[ $(git status --porcelain) ]]; then
36+
echo '::error::Uncommitted changes detected. Please run `make generate` and commit the generated code.'
37+
echo 'Modified files:'
38+
git status --porcelain
39+
exit 1
40+
else
41+
echo 'No uncommitted changes. All generated code is up to date.'
42+
fi

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,4 @@ courtney/
1818

1919
mocks/
2020

21-
internal/lido/contracts/csaccounting/CSAccounting.go
22-
23-
internal/lido/contracts/csfeedistributor/CSFeeDistributor.go
24-
25-
internal/lido/contracts/csmodule/CSModule.go
26-
27-
internal/lido/contracts/mevboostrelaylist/MEVBoostRelayAllowedList.go
28-
2921
build/lido-exporter

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Update Go version from 1.21 to 1.22.
1717
- Update documentation versions and dependencies.
1818
- Update Lido Mainnet Vetted Relays List.
19+
- Remove the need of users cloning the repository to run `make generate` and `make compile`, rolling back to only `make compile`
1920

2021
### Fixed
2122
- Teku and Lighthouse import keys container error on Windows.

internal/lido/contracts/csaccounting/CSAccounting.go

Lines changed: 6362 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/lido/contracts/csfeedistributor/CSFeeDistributor.go

Lines changed: 2598 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/lido/contracts/csmodule/CSModule.go

Lines changed: 8154 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/lido/contracts/mevboostrelaylist/MEVBoostRelayAllowedList.go

Lines changed: 1422 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)