separate detector tests

This commit is contained in:
Dustin Decker
2022-01-19 09:27:22 -08:00
parent 7be513c567
commit f7dca85d2d
2 changed files with 37 additions and 4 deletions
+32 -2
View File
@@ -1,9 +1,14 @@
name: Test
on:
push:
tags:
- v*
branches:
- main
pull_request:
name: Test
jobs:
test:
strategy:
@@ -27,4 +32,29 @@ jobs:
workload_identity_provider: 'projects/811013774421/locations/global/workloadIdentityPools/github-pool/providers/github-provider'
service_account: 'github-ci-external@trufflehog-testing.iam.gserviceaccount.com'
- name: Test
run: go test -timeout 30s ./...
run: make test
test-detectors:
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
workload_identity_provider: 'projects/811013774421/locations/global/workloadIdentityPools/github-pool/providers/github-provider'
service_account: 'github-ci-external@trufflehog-testing.iam.gserviceaccount.com'
- name: Test
run: make test-detectors
continue-on-error: true
+5 -2
View File
@@ -20,10 +20,13 @@ test-failing:
CGO_ENABLED=0 go test -timeout=30s $(shell go list ./... | grep -v /vendor/) | grep FAIL
test:
CGO_ENABLED=0 go test -timeout=30s $(shell go list ./... | grep -v /vendor/)
CGO_ENABLED=0 go test -timeout=30s $(shell go list ./... | grep -v /vendor/ | grep -v /pkg/detectors)
test-race:
CGO_ENABLED=1 go test -timeout=30s -race $(shell go list ./... | grep -v /vendor/)
CGO_ENABLED=1 go test -timeout=30s -race $(shell go list ./... | grep -v /vendor/ | grep -v /pkg/detectors)
test-detectors:
CGO_ENABLED=0 go test -timeout=30s $(shell go list ./... | grep /pkg/detectors)
bench:
CGO_ENABLED=0 go test $(shell go list ./pkg/secrets/... | grep -v /vendor/) -benchmem -run=xxx -bench .