2024-03-12 04:28:04 +08:00
|
|
|
name: Quality check
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "*"
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
static-analysis:
|
|
|
|
name: Static analysis
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: 'stable'
|
|
|
|
|
2024-05-08 14:12:24 +08:00
|
|
|
- name: Install pcap
|
|
|
|
run: sudo apt install -y libpcap-dev
|
|
|
|
|
2024-03-12 04:28:04 +08:00
|
|
|
- run: go vet ./...
|
|
|
|
|
|
|
|
- name: staticcheck
|
|
|
|
uses: dominikh/staticcheck-action@v1.3.0
|
|
|
|
with:
|
|
|
|
install-go: false
|
|
|
|
|
|
|
|
tests:
|
|
|
|
name: Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: 'stable'
|
|
|
|
|
2024-05-08 14:13:58 +08:00
|
|
|
- name: Install pcap
|
|
|
|
run: sudo apt install -y libpcap-dev
|
|
|
|
|
2024-03-12 04:28:04 +08:00
|
|
|
- run: go test ./...
|