mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-12-24 04:20:47 +00:00
202 lines
5.8 KiB
YAML
202 lines
5.8 KiB
YAML
name: Static code analysis
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- 'develop'
|
|
- 'main'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
go-lint:
|
|
name: Go lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '^1.17'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y libpcap-dev
|
|
|
|
- name: Check Agent modified files
|
|
id: agent_modified_files
|
|
run: devops/check_modified_files.sh agent/
|
|
|
|
- name: Go lint - agent
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.agent_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: agent
|
|
args: --timeout=3m
|
|
|
|
- name: Check shared modified files
|
|
id: shared_modified_files
|
|
run: devops/check_modified_files.sh shared/
|
|
|
|
- name: Go lint - shared
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.shared_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: shared
|
|
args: --timeout=3m
|
|
|
|
- name: Check tap modified files
|
|
id: tap_modified_files
|
|
run: devops/check_modified_files.sh tap/
|
|
|
|
- name: Go lint - tap
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.tap_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: tap
|
|
args: --timeout=3m
|
|
|
|
- name: Check cli modified files
|
|
id: cli_modified_files
|
|
run: devops/check_modified_files.sh cli/
|
|
|
|
- name: Go lint - CLI
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.cli_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: cli
|
|
args: --timeout=3m
|
|
|
|
- name: Check acceptanceTests modified files
|
|
id: acceptanceTests_modified_files
|
|
run: devops/check_modified_files.sh acceptanceTests/
|
|
|
|
- name: Go lint - acceptanceTests
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.acceptanceTests_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: acceptanceTests
|
|
args: --timeout=3m
|
|
|
|
- name: Check tap/api modified files
|
|
id: tap_api_modified_files
|
|
run: devops/check_modified_files.sh tap/api/
|
|
|
|
- name: Go lint - tap/api
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.tap_api_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: tap/api
|
|
|
|
- name: Check tap/extensions/amqp modified files
|
|
id: tap_amqp_modified_files
|
|
run: devops/check_modified_files.sh tap/extensions/amqp/
|
|
|
|
- name: Go lint - tap/extensions/amqp
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.tap_amqp_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: tap/extensions/amqp
|
|
|
|
- name: Check tap/extensions/http modified files
|
|
id: tap_http_modified_files
|
|
run: devops/check_modified_files.sh tap/extensions/http/
|
|
|
|
- name: Go lint - tap/extensions/http
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.tap_http_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: tap/extensions/http
|
|
|
|
- name: Check tap/extensions/kafka modified files
|
|
id: tap_kafka_modified_files
|
|
run: devops/check_modified_files.sh tap/extensions/kafka/
|
|
|
|
- name: Go lint - tap/extensions/kafka
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.tap_kafka_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: tap/extensions/kafka
|
|
|
|
- name: Check tap/extensions/redis modified files
|
|
id: tap_redis_modified_files
|
|
run: devops/check_modified_files.sh tap/extensions/redis/
|
|
|
|
- name: Go lint - tap/extensions/redis
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.tap_redis_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: tap/extensions/redis
|
|
|
|
- name: Check logger modified files
|
|
id: logger_modified_files
|
|
run: devops/check_modified_files.sh logger/
|
|
|
|
- name: Go lint - logger
|
|
uses: golangci/golangci-lint-action@v2
|
|
if: steps.logger_modified_files.outputs.matched == 'true'
|
|
with:
|
|
version: latest
|
|
working-directory: logger
|
|
|
|
es-lint:
|
|
name: ES lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16
|
|
|
|
- name: Check modified UI files
|
|
id: ui_modified_files
|
|
run: devops/check_modified_files.sh ui/
|
|
|
|
- name: ESLint prerequisites ui
|
|
if: steps.ui_modified_files.outputs.matched == 'true'
|
|
run: |
|
|
sudo npm install -g eslint
|
|
cd ui
|
|
npm run prestart
|
|
npm i
|
|
|
|
- name: ESLint ui
|
|
if: steps.ui_modified_files.outputs.matched == 'true'
|
|
run: |
|
|
cd ui
|
|
npm run eslint
|
|
|
|
- name: Check modified ui-common files
|
|
id: ui_common_modified_files
|
|
run: devops/check_modified_files.sh ui-common/
|
|
|
|
- name: ESLint prerequisites ui-common
|
|
if: steps.ui_common_modified_files.outputs.matched == 'true'
|
|
run: |
|
|
sudo npm install -g eslint
|
|
cd ui-common
|
|
npm i
|
|
|
|
- name: ESLint ui-common
|
|
if: steps.ui_common_modified_files.outputs.matched == 'true'
|
|
run: |
|
|
cd ui-common
|
|
npm run eslint
|