Files
fission-src/.github/workflows/lint.yaml
T
soharab-icandGitHub 4b76ec9057 Update Keda-connectors version and go packages (#3029)
* Update keda-connectors version
* Update github actions
* Fix github workflow lint issues
* Updated following go packages
```
* dario.cat/mergo: v1.0.0 -> v1.0.1
* github.com/IBM/sarama: v1.43.2 -> v1.43.3
* github.com/influxdata/influxdb: v1.11.5 -> v1.11.6
* github.com/prometheus/client_golang: v1.19.1 -> v1.20.4
* github.com/prometheus/common: v0.55.0 -> v0.59.1
* go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.53.0 -> v0.55.0
* go.opentelemetry.io/contrib/propagators/autoprop: v0.51.0 -> v0.55.0
* go.opentelemetry.io/otel: v1.28.0 -> v1.30.0
* go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.28.0 -> v1.30.0
* go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.27.0 -> v1.30.0
* go.opentelemetry.io/otel/sdk: v1.28.0 -> v1.30.0
* go.opentelemetry.io/otel/trace: v1.28.0 -> v1.30.0
* golang.org/x/net: v0.28.0 -> v0.29.0
* google.golang.org/grpc: v1.65.0 -> v1.67.1
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* The `set-output` command is deprecated.
Fix typos in release workflow.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-10-01 14:12:51 +05:30

70 lines
1.7 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
workflow_dispatch:
env:
GOLANGCI_LINT_VERSION: v1.61.0
GOLANGCI_LINT_TIMEOUT: 5m
jobs:
lint:
runs-on: ubuntu-latest
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
steps:
- name: Check out code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
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@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.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@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: ./coverage.txt