-
-
Notifications
You must be signed in to change notification settings - Fork 592
chore(ci): run lint in a separate build before running the tests #2876
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 83 commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
c9c63bd
chore: run lint in a separate build before running the tests
mdelapenya 4bab0fd
fix: lint work dir
mdelapenya 2f6d74e
Revert "fix: lint work dir"
mdelapenya 77b8c25
Revert "chore: run lint in a separate build before running the tests"
mdelapenya eaef8e1
chore: detect modified files and select which module to run the tests…
mdelapenya cfcec39
fix: read env var properly
mdelapenya 4a4482f
fix: simplify
mdelapenya 6550d8e
fix: single quotes
mdelapenya 93934ac
chore: remove job
mdelapenya 2e35ae8
fix: proper all_modified_files quotes
mdelapenya 87d9718
chore: print out modules to run
mdelapenya 4b63312
fix: do not send an array with all modules, but a comma-separated lis…
mdelapenya 1c17f59
fix: do not prepend the root_dir for the modules
mdelapenya f68e6af
chore: proper runner definition
mdelapenya 3272c43
fix: use runner in the right place
mdelapenya 5e1f13a
chore: separate lint to a different workflow
mdelapenya 8a51fe6
fix: use fromJson
mdelapenya e9e62cc
fix: proper jobs chain
mdelapenya d0cf9ab
fix: no need to lint twice
mdelapenya afedcd6
fix: remove non-existing input
mdelapenya 2352d19
fix: sanitise path
mdelapenya ff1a5cf
chore: only run the reaper if the core module is modified
mdelapenya e30d9a0
revert: simple lint
mdelapenya 84d2fd9
Revert "revert: simple lint"
mdelapenya d66f266
revet: remove lint
mdelapenya e6636ac
Revert "revet: remove lint"
mdelapenya 02fe23f
chore: try with input platform
mdelapenya c5db8ab
fix: forgotten platform
mdelapenya 49f7473
fix: pass a string to the reusable workflow
mdelapenya b4480a8
fix: remove missing parenthesis
mdelapenya 2638f2a
fix: proper input value as string
mdelapenya c7e5e7e
fix: order properly
mdelapenya 5514edd
chore: simplify merging scripts
mdelapenya 718e0bc
fix: proper array syntax
mdelapenya a6b0e53
fix: outputs are consumed by downstream jobs that needs the producer
mdelapenya 3314f8d
fix: remove extra element
mdelapenya 459de9f
chore: detemine platform in downstream job
mdelapenya e23c1cd
fix: read env properly
mdelapenya c7476de
chore: define runner in a previos step
mdelapenya 9a3f6f9
fix: proper output format
mdelapenya b75cf65
Revert "fix: proper output format"
mdelapenya 607fb1f
Revert "chore: define runner in a previos step"
mdelapenya f8dd7b9
chore: define matrix for the downstream job
mdelapenya f782846
fix: try with string
mdelapenya 9bc5a52
fix: use fromJSON
mdelapenya 963de87
fix: items
mdelapenya fb33924
chore: default as string
mdelapenya 7bc38cc
chore: pass platforms in the parent workflow
mdelapenya c12c7a6
fix: single platforms must follow the array-instring format
mdelapenya bfddbc6
chore: exclude certain locations from the root dir
mdelapenya 4b8d2fa
fix: use jq to get modules count
mdelapenya 8e5691c
chore: do not run sonarcloud for zero modules
mdelapenya 7a2fe26
chore: separate concerns
mdelapenya 0a387e9
chore: format variable name
mdelapenya b638baa
chore: no need to generate the ci.yml anymore
mdelapenya d4adfd5
chore: merge lint and test workflow files again
mdelapenya f9682df
fix: missing lint job in workflow
mdelapenya 730f3e6
chore: run lint first
mdelapenya b939d62
fix: update name
mdelapenya 0aab655
Merge branch 'main' into run-lint-first
mdelapenya b8920ef
Merge branch 'main' into run-lint-first
mdelapenya d8d62d7
fix: pin the action commit
mdelapenya a63796b
Merge branch 'main' into run-lint-first
mdelapenya da8b161
chore: matrix.platform
mdelapenya 25c1a90
Merge branch 'main' into run-lint-first
mdelapenya 0b714eb
Merge branch 'main' into run-lint-first
mdelapenya 12a90ab
chore: run lint stage before the test one
mdelapenya 1f63457
Merge branch 'main' into run-lint-first
mdelapenya b1ce85f
Merge branch 'main' into run-lint-first
mdelapenya c0a4ecf
Merge branch 'main' into run-lint-first
mdelapenya f4845d2
Merge branch 'main' into run-lint-first
mdelapenya c23502c
Merge branch 'main' into run-lint-first
mdelapenya 6cb373e
chore: no need to read modulegen/_template in dependabot
mdelapenya ea94574
chore: scripts is not excluded
mdelapenya 2af692e
chore: exit on error, unset variables, print commands, fail on pipe e…
mdelapenya 118327a
chore: remove verbosity in golangci-lint in the GH workflow
mdelapenya ea6dfbb
chore: use pinned version with 3 digits
mdelapenya 2128811
chore: bump golangci-lint version to match makefile's
mdelapenya 674653a
chore: omit default value for continue-on-error
mdelapenya 7971ae2
chore: simplify removing the continue-on-error input
mdelapenya e0c395f
chore: bump golangci-lint GH action version
mdelapenya 3617369
chore: do not run mod verify on new GH workers
mdelapenya ec4302e
fix: do not fail-fast modules
mdelapenya 3368afd
chore: do not skip cache for golangci-lint GH action
mdelapenya 7684c55
Merge branch 'main' into run-lint-first
stevenh 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
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,56 @@ | ||
| name: Run lint for a Go project | ||
| run-name: "${{ inputs.project-directory }}" | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| project-directory: | ||
| required: true | ||
| type: string | ||
| default: "." | ||
| description: "The directory where the Go project is located." | ||
|
|
||
| permissions: | ||
| contents: read | ||
| # Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
| # pull-requests: read | ||
|
|
||
| jobs: | ||
| lint-go-project: | ||
| name: "lint: ${{ inputs.project-directory }}" | ||
| runs-on: 'ubuntu-latest' | ||
| steps: | ||
| - name: Check out code into the Go module directory | ||
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
| with: | ||
| go-version-file: "${{ inputs.project-directory == '' && '.' || inputs.project-directory }}/go.mod" | ||
| cache-dependency-path: "${{ inputs.project-directory == '' && '.' || inputs.project-directory }}/go.sum" | ||
| id: go | ||
|
|
||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0 | ||
| with: | ||
| # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
| version: v1.63.4 | ||
| # Optional: working directory, useful for monorepos | ||
| working-directory: ${{ inputs.project-directory }} | ||
| # Optional: if set to true then the all caching functionality will be complete disabled, | ||
| # takes precedence over all other caching options. | ||
| skip-cache: true | ||
|
|
||
| - name: generate | ||
| working-directory: ./${{ inputs.project-directory }} | ||
| shell: bash | ||
| run: | | ||
| make generate | ||
| git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]] | ||
|
|
||
| - name: modTidy | ||
| working-directory: ./${{ inputs.project-directory }} | ||
| shell: bash | ||
| run: | | ||
| make tidy | ||
| git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]] | ||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why set this to true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already set to true in the main branch 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it might be hang over from quite a few versions back where
actions/setup-goandgolangci/golangci-lint-actionboth used to cache package and build, but this was fixed in v4.I would suggest removing it as it can have a significant impact on the time taken to run the linter, especially as we've been enabling more linting recently.