-
Notifications
You must be signed in to change notification settings - Fork 236
Addition of a Shadow Go Static Check which is 75% faster than the existing Check Saving 35mins per run #5799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0629649
Remove static sleep and incorrect code from zrp_laser_bias_current_test
RishabhAgarwal-2001 cdff8ec
Skip cleaning cache and avoid .pb.go files in fmt
RishabhAgarwal-2001 5763831
AI attempt 2
RishabhAgarwal-2001 b064ad5
using third-party action instead of our own
RishabhAgarwal-2001 80d47f0
Introduce failure in zrp
RishabhAgarwal-2001 e5597b4
Fix FMT issues
RishabhAgarwal-2001 2d28a7b
Experimenting with arm64 runners
RishabhAgarwal-2001 dc90014
Merge branch 'main' into rishabh/exp-speed-up-static-check
RishabhAgarwal-2001 0992920
Address Zirmor issues
RishabhAgarwal-2001 2e3c70c
Add permissions to go.yml
RishabhAgarwal-2001 4cc170c
Pin Runner version for Arm64
RishabhAgarwal-2001 2460848
Add cache envs
RishabhAgarwal-2001 31e08d9
Remove GOGC=30
RishabhAgarwal-2001 32da65f
Print cache size after static check
RishabhAgarwal-2001 13d6d54
Store the cache - /mnt/cache/staticcheck
RishabhAgarwal-2001 7ca6356
Create a separate experimental action
RishabhAgarwal-2001 845e60d
Merge branch 'main' into rishabh/exp-speed-up-static-check
RishabhAgarwal-2001 6e5f5c6
Add names to avoid matching with the required check
RishabhAgarwal-2001 69c8bfe
Merge branch 'main' into rishabh/exp-speed-up-static-check
RishabhAgarwal-2001 6bde135
Use correct cache key
RishabhAgarwal-2001 2ec7271
Merge branch 'main' into rishabh/exp-speed-up-static-check
RishabhAgarwal-2001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| name: Go (ARM64 Experimental) | ||
|
RishabhAgarwal-2001 marked this conversation as resolved.
|
||
|
|
||
| # NOTE: This is an experimental workflow running on ARM64 infrastructure to | ||
| # evaluate execution speed and GitHub caching. | ||
| # DO NOT add this check as a required status check for branch protection. | ||
| # If this workflow fails, it should NOT block merges to main. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| XDG_CACHE_HOME: /mnt/cache | ||
| GOMODCACHE: /mnt/cache/go-mod | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build (ARM64) | ||
| runs-on: ubuntu-24.04-arm | ||
|
RishabhAgarwal-2001 marked this conversation as resolved.
|
||
| steps: | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| # Go & staticcheck build cache require a lot of disk space. Reclaim extra | ||
| # space for the container by removing unnecessary tooling. | ||
| - name: Free additional disk space and prepare cache directory | ||
| run: | | ||
| sudo rm -rf /usr/share/dotnet | ||
| sudo rm -rf /usr/local/lib/android | ||
| sudo rm -rf /opt/hostedtoolcache/CodeQL | ||
| sudo mkdir -p /mnt/cache | ||
| sudo chown -R $USER:$USER /mnt/cache | ||
| - name: Set up Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| cache: true | ||
| # Cache location is managed by XDG_CACHE_HOME env variable | ||
| # Dependency for Go module github.com/google/gopacket | ||
| - name: Install libpcap-dev | ||
| run: sudo apt-get -y install libpcap-dev | ||
| - name: Build | ||
| run: go build -v ./... | ||
|
|
||
| test: | ||
| name: Test (ARM64) | ||
| runs-on: ubuntu-24.04-arm | ||
| steps: | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| # Go & staticcheck build cache require a lot of disk space. Reclaim extra | ||
| # space for the container by removing unnecessary tooling. | ||
| - name: Free additional disk space and prepare cache directory | ||
| run: | | ||
| sudo rm -rf /usr/share/dotnet | ||
| sudo rm -rf /usr/local/lib/android | ||
| sudo rm -rf /opt/hostedtoolcache/CodeQL | ||
| sudo mkdir -p /mnt/cache | ||
| sudo chown -R $USER:$USER /mnt/cache | ||
| - name: Set up Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| cache: true | ||
| # Cache location is managed by XDG_CACHE_HOME env variable | ||
| # Dependency for Go module github.com/google/gopacket | ||
| - name: Install libpcap-dev | ||
| run: sudo apt-get -y install libpcap-dev | ||
| - run: go test -v -coverprofile=profile.cov $(go list ./... | grep -v /.*test.*) | ||
| - name: Send coverage | ||
| continue-on-error: true | ||
| uses: shogo82148/actions-goveralls@7b1bd2871942af030d707d6574e5f684f9891fb2 | ||
| with: | ||
| path-to-profile: profile.cov | ||
|
|
||
| static_analysis: | ||
| name: Static Analysis (ARM64) | ||
| runs-on: ubuntu-24.04-arm | ||
| steps: | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| - name: Free additional disk space and prepare cache directory | ||
| run: | | ||
| sudo rm -rf /usr/share/dotnet | ||
| sudo rm -rf /usr/local/lib/android | ||
| sudo rm -rf /opt/hostedtoolcache/CodeQL | ||
| sudo mkdir -p /mnt/cache | ||
| sudo chown -R $USER:$USER /mnt/cache | ||
| - name: Set up Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| cache: true | ||
| # Cache location is managed by XDG_CACHE_HOME env variable | ||
| # Dependency for Go module github.com/google/gopacket | ||
| - name: Install libpcap-dev | ||
| run: sudo apt-get -y install libpcap-dev | ||
|
|
||
| # Removed counter-productive go clean -cache | ||
|
|
||
| - name: Go vet | ||
| run: go vet ./... | ||
| - name: Gofmt | ||
| run: | | ||
| # gofmt always returns true, so we use grep '^' which returns | ||
| # true on non-empty output, but will otherwise passthrough all | ||
| # output lines. | ||
| if gofmt -d -s . | grep '^'; then | ||
| exit 1 | ||
| fi | ||
| - name: Get goimports | ||
| run: go install golang.org/x/tools/cmd/goimports@latest | ||
| - name: Goimports | ||
| run: | | ||
| # goimports always returns true, so we use grep '^' which returns | ||
| # true on non-empty output, but will otherwise passthrough all | ||
| # output lines. | ||
| # | ||
| # goimports does not support "gofmt -s" so both goimports and gofmt are | ||
| # required. | ||
| find . -name "*.go" | egrep -v "pb.go$" | while read l; do | ||
| if goimports -d $l | grep '^'; then | ||
| exit 1; | ||
| fi; | ||
| done | ||
| - name: Get revive | ||
| run: go install github.com/mgechev/revive@v1.3.4 | ||
| - name: Run revive | ||
| run: revive ./... | ||
| - name: Get staticcheck | ||
| run: go install honnef.co/go/tools/cmd/staticcheck@latest | ||
| - name: Cache staticcheck | ||
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | ||
| with: | ||
|
RishabhAgarwal-2001 marked this conversation as resolved.
|
||
| path: /mnt/cache/staticcheck | ||
| key: ${{ runner.os }}-staticcheck-${{ github.sha }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-staticcheck- | ||
| - name: Run staticcheck | ||
| run: staticcheck ./... | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.