forked from grafana/k6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the linter CI action reusable by other repos (grafana#3033)
- Loading branch information
Showing
2 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: golangci-lint-k6 | ||
description: Run golangci-lint with the k6 ruleset | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.20.x | ||
check-latest: true | ||
- name: Get golangci-lint version and download rules | ||
shell: bash | ||
env: #TODO: remove after https://github.com/actions/runner/issues/2473 is fixed | ||
GITHUB_ACTION_REF: ${{ github.action_ref || github.head_ref }} | ||
run: | | ||
RulesURL="https://raw.githubusercontent.com/grafana/k6/${{ env.GITHUB_ACTION_REF }}/.golangci.yml" | ||
echo "Downloading ${RulesURL}..." | ||
curl --silent --show-error --fail --no-location "${RulesURL}" --output "${{ github.action_path }}/.golangci.yml" | ||
echo "GolangCIVersion=$(head -n 1 "${{ github.action_path }}/.golangci.yml" | tr -d '# ')" >> "${GITHUB_OUTPUT}" | ||
id: getenv | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: ${{ steps.getenv.outputs.GolangCIVersion }} | ||
only-new-issues: true | ||
args: "--config=${{ github.action_path }}/.golangci.yml" |
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