Files
fission-src/.github/workflows/lint.yaml
T
Sanket SudakeandGitHub 20e0f6af45 Update release version v1.22.0 (#3270)
* Update release version v1.22.0

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* Update few go deps

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* update controller-runtime to v0.22.3

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* Update tools versions

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2025-11-03 18:18:14 +05:30

84 lines
2.1 KiB
YAML

name: Lint and Unit tests
on:
push:
branches:
- main
paths:
- "**.go"
- go.mod
- go.sum
pull_request:
branches:
- main
paths:
- "**.go"
- go.mod
- go.sum
env:
GOLANGCI_LINT_VERSION: v2.6.0
GOLANGCI_LINT_TIMEOUT: 5m
permissions:
contents: read
concurrency:
group: fission-lint-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
runs-on: ubuntu-24.04
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Check out code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: "go.mod"
cache: true
- name: Verify dependencies
run: |
go mod verify
go mod download
- name: Run golangci-lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
skip-cache: true
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}
- name: Detect git changes
if: always()
run: |
if [[ $(git diff --stat) != '' ]]; then
echo -e '❌ \033[0;31m. Fix lint changes.\033[0m'
git diff --color
exit 1
else
echo '✔ No issues detected. Have a nice day :-)'
fi
- name: Run unit tests
run: ./hack/runtests.sh
- name: Upload Coverage report to CodeCov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: ./coverage.txt