mirror of
https://github.com/aquasecurity/trivy.git
synced 2026-01-31 13:53:14 +08:00
60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
name: Test
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
env:
|
|
GO_VERSION: "1.18"
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
- name: Setup golangci-lint
|
|
uses: golangci/golangci-lint-action@v3.2.0
|
|
with:
|
|
version: v1.45
|
|
args : --verbose
|
|
skip-go-installation: true
|
|
unittest:
|
|
name: Unit Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install dependencies
|
|
run: sudo apt-get update && sudo apt-get install libdb-dev
|
|
- name: Run unit tests
|
|
run: make test
|
|
integration:
|
|
name: Integration Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install dependencies
|
|
run: sudo apt-get update && sudo apt-get install libdb-dev
|
|
|
|
- name: Run integration tests
|
|
run: make test-integration
|