mirror of
https://github.com/projectdiscovery/nuclei
synced 2026-06-08 16:50:47 +00:00
a783a82686
Signed-off-by: Dwi Siswanto <git@dw1.io>
169 lines
4.5 KiB
YAML
169 lines
4.5 KiB
YAML
name: 🔨 Tests
|
|
|
|
on:
|
|
push:
|
|
branches: ["dev"]
|
|
paths:
|
|
- '**.go'
|
|
- '**.mod'
|
|
pull_request:
|
|
paths:
|
|
- '**.go'
|
|
- '**.mod'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: "Lint"
|
|
if: ${{ !endsWith(github.actor, '[bot]') }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: projectdiscovery/actions/setup/go@v1
|
|
- uses: projectdiscovery/actions/golangci-lint/v2@v1
|
|
|
|
tests:
|
|
name: "Tests"
|
|
needs: ["lint"]
|
|
env:
|
|
GITHUB_TOKEN: "${{ github.token }}"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
runs-on: "${{ matrix.os }}"
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: projectdiscovery/actions/setup/go@v1
|
|
- uses: projectdiscovery/nuclei-action/cache@v3
|
|
- uses: projectdiscovery/actions/free-disk-space@v1
|
|
with:
|
|
llvm: 'false'
|
|
php: 'false'
|
|
mongodb: 'false'
|
|
mysql: 'false'
|
|
misc-packages: 'false'
|
|
docker-images: 'false'
|
|
tools-cache: 'false'
|
|
- run: make vet
|
|
- run: make build
|
|
- run: make test
|
|
env:
|
|
PDCP_API_KEY: "${{ secrets.PDCP_API_KEY }}"
|
|
- run: go run -race . -l ${{ github.workspace }}/internal/tests/functional/testdata/targets.txt -id tech-detect,tls-version
|
|
if: ${{ matrix.os != 'windows-latest' }} # known issue: https://github.com/golang/go/issues/46099
|
|
working-directory: cmd/nuclei/
|
|
|
|
sdk:
|
|
name: "Run example SDK"
|
|
needs: ["tests"]
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GITHUB_TOKEN: "${{ github.token }}"
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: projectdiscovery/actions/setup/go@v1
|
|
- uses: projectdiscovery/nuclei-action/cache@v3
|
|
- name: "Simple"
|
|
run: go run .
|
|
working-directory: examples/simple/
|
|
# - run: go run . # Temporarily disabled very flaky in github actions
|
|
# working-directory: examples/advanced/
|
|
|
|
# TODO: FIX with ExecutionID (ref: https://github.com/projectdiscovery/nuclei/pull/6296)
|
|
# - name: "with Speed Control"
|
|
# run: go run .
|
|
# working-directory: examples/with_speed_control/
|
|
|
|
integration:
|
|
name: "Integration tests"
|
|
needs: ["tests"]
|
|
env:
|
|
GITHUB_TOKEN: "${{ github.token }}"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: projectdiscovery/actions/setup/python@v1
|
|
- uses: projectdiscovery/actions/setup/go@v1
|
|
- run: make integration
|
|
env:
|
|
PDCP_API_KEY: "${{ secrets.PDCP_API_KEY }}"
|
|
timeout-minutes: 50
|
|
|
|
functional:
|
|
name: "Functional tests"
|
|
needs: ["tests"]
|
|
env:
|
|
GITHUB_TOKEN: "${{ github.token }}"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: projectdiscovery/actions/setup/python@v1
|
|
- uses: projectdiscovery/actions/setup/go@v1
|
|
- uses: projectdiscovery/nuclei-action@v3
|
|
with:
|
|
version: latest
|
|
install-only: true
|
|
- run: make functional
|
|
|
|
validate:
|
|
name: "Template validate"
|
|
needs: ["tests"]
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GITHUB_TOKEN: "${{ github.token }}"
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: projectdiscovery/actions/setup/go@v1
|
|
- uses: projectdiscovery/nuclei-action/cache@v3
|
|
- run: make template-validate
|
|
|
|
codeql:
|
|
name: "CodeQL analysis"
|
|
needs: ["tests"]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: read
|
|
contents: read
|
|
security-events: write
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: github/codeql-action/init@v4
|
|
with:
|
|
languages: 'go'
|
|
- uses: github/codeql-action/autobuild@v4
|
|
- uses: github/codeql-action/analyze@v4
|
|
|
|
release:
|
|
name: "Release test"
|
|
needs: ["tests"]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: projectdiscovery/actions/setup/go@v1
|
|
with:
|
|
go-version: "stable"
|
|
- uses: projectdiscovery/actions/goreleaser@v1
|
|
|
|
flamegraph:
|
|
name: "Flamegraph"
|
|
needs: ["tests"]
|
|
uses: ./.github/workflows/flamegraph.yaml
|
|
|
|
# perf-regression:
|
|
# name: "Performance regression"
|
|
# needs: ["tests"]
|
|
# uses: ./.github/workflows/perf-regression.yaml
|