mirror of
https://github.com/prometheus/prometheus.git
synced 2026-01-17 22:51:03 +01:00
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
name: fuzzing
|
|
on:
|
|
workflow_call:
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
fuzzing:
|
|
name: Run Go Fuzz Tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
fuzz_test: [FuzzParseMetricText, FuzzParseOpenMetric, FuzzParseMetricSelector, FuzzParseExpr]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install Go
|
|
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
|
with:
|
|
go-version: 1.25.x
|
|
- name: Run Fuzzing
|
|
run: go test -fuzz=${{ matrix.fuzz_test }}$ -fuzztime=5m ./util/fuzzing
|
|
continue-on-error: true
|
|
id: fuzz
|
|
- name: Upload Crash Artifacts
|
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
if: failure()
|
|
with:
|
|
name: fuzz-artifacts-${{ matrix.fuzz_test }}
|
|
path: promql/testdata/fuzz/${{ matrix.fuzz_test }}
|
|
fuzzing_status:
|
|
# This status check aggregates the individual matrix jobs of the fuzzing
|
|
# step into a final status. Fails if a single matrix job fails, succeeds if
|
|
# all matrix jobs succeed.
|
|
name: Fuzzing
|
|
runs-on: ubuntu-latest
|
|
needs: [fuzzing]
|
|
if: always()
|
|
steps:
|
|
- name: Successful fuzzing
|
|
if: ${{ !(contains(needs.*.result, 'failure')) && !(contains(needs.*.result, 'cancelled')) }}
|
|
run: exit 0
|
|
- name: Failing or cancelled fuzzing
|
|
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
|
|
run: exit 1
|