Run golangci-lint with the make lint-go target, adjust workflows (#1778)
This commit is contained in:
@@ -176,22 +176,3 @@ jobs:
|
||||
run: |
|
||||
MYSQL_TEST=1 make test-go
|
||||
|
||||
|
||||
lint-go:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
go-version: ['^1.16.0']
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run Go Linting
|
||||
run: |
|
||||
make lint-go
|
||||
|
||||
@@ -110,7 +110,7 @@ lint-js:
|
||||
yarn lint
|
||||
|
||||
lint-go:
|
||||
go vet ./...
|
||||
golangci-lint run
|
||||
|
||||
lint: lint-go lint-js
|
||||
|
||||
@@ -238,7 +238,7 @@ e2e-setup:
|
||||
./build/fleetctl user create --context e2e --email=sso_user@example.com --name "SSO user" --sso=true
|
||||
|
||||
e2e-serve-core:
|
||||
FLEET_SOFTWARE_INVENTORY=1 ./build/fleet serve --mysql_address=localhost:3307 --mysql_username=root --mysql_password=toor --mysql_database=e2e --server_address=0.0.0.0:8642
|
||||
FLEET_SOFTWARE_INVENTORY=1 ./build/fleet serve --mysql_address=localhost:3307 --mysql_username=root --mysql_password=toor --mysql_database=e2e --server_address=0.0.0.0:8642
|
||||
|
||||
e2e-serve-basic:
|
||||
FLEET_SOFTWARE_INVENTORY=1 ./build/fleet serve --dev_license --mysql_address=localhost:3307 --mysql_username=root --mysql_password=toor --mysql_database=e2e --server_address=0.0.0.0:8642
|
||||
|
||||
@@ -31,7 +31,13 @@ Check out [the instructions in the `/tools/osquery` directory](../../tools/osque
|
||||
|
||||
## Test suite
|
||||
|
||||
To execute the basic unit and integration tests, run the following from the root of the repository:
|
||||
You must install the [`golangci-lint`](https://golangci-lint.run/) command to run `make test[-go]` or `make lint[-go]`, using:
|
||||
|
||||
```
|
||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.0
|
||||
```
|
||||
|
||||
Make sure it is available in your PATH. To execute the basic unit and integration tests, run the following from the root of the repository:
|
||||
|
||||
```
|
||||
MYSQL_TEST=1 make test
|
||||
|
||||
Reference in New Issue
Block a user