Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 12 additions & 25 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,41 +81,26 @@ jobs:
- name: Enforce benchmark thresholds
run: |
go test ./internal/handlers/... -bench=. -benchmem -benchtime=3s -run=^$ 2>&1 | tee threshold_check.txt

# Check PlansSmall
SMALL_LATENCY=$(grep -oP 'Plans/Small\t*\d+\s+ns/op' threshold_check.txt | awk '{print $2}')
if [ -n "$SMALL_LATENCY" ] && [ "$SMALL_LATENCY" -gt 30000 ]; then
echo "❌ Plans Small latency ($SMALL_LATENCY ns) exceeds threshold (30000 ns)"
exit 1
fi
# Check SubscriptionsSmall

# Check SubscriptionsSmall
SUB_LATENCY=$(grep -oP 'Subscriptions/Small\t*\d+\s+ns/op' threshold_check.txt | awk '{print $2}')
if [ -n "$SUB_LATENCY" ] && [ "$SUB_LATENCY" -gt 35000 ]; then
echo "❌ Subscriptions Small latency ($SUB_LATENCY ns) exceeds threshold (35000 ns)"
exit 1
fi

echo "✅ All benchmark thresholds enforced"

- name: Enforce benchmark thresholds
run: |

echo "## Performance Threshold Check" >> $GITHUB_STEP_SUMMARY

# Run threshold-enforcing benchmarks
go test ./internal/handlers/... -run=^TestBenchmarkThresholds -v | tee threshold_check.txt

# Check if thresholds are being met
if grep -q "FAIL\|FAIL" threshold_check.txt; then
echo "❌ Performance thresholds not met"
cat threshold_check.txt >> $GITHUB_STEP_SUMMARY
exit 1
fi

echo "✅ All benchmark thresholds passed"
echo '```' >> $GITHUB_STEP_SUMMARY
cat threshold_check.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "✅ All benchmark thresholds enforced"

- name: Upload results
uses: actions/upload-artifact@v4
Expand All @@ -130,17 +115,19 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: benchmark-baseline
path: new.txt
path: |
handlers_new.txt
subscriptions_new.txt

security:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.22'

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ jobs:
echo "| FuzzListPlans | ${{ needs.fuzz-list-plans.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| FuzzListStatements | ${{ needs.fuzz-list-statements.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| FuzzSwapInput | ${{ needs.fuzz-swap-input.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| FuzzSwapExactIn | ${{ needs.fuzz-swap-exact-in.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| FuzzSwapExactOut | ${{ needs.fuzz-swap-exact-out.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| FuzzSwapRawBody | ${{ needs.fuzz-swap-raw-body.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Fuzz time per target: \`${{ env.FUZZ_TIME }}\`" >> $GITHUB_STEP_SUMMARY
echo "Run ID: ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion .github/workflows/reconciliation-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/test-jwt-hardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.25", "1.24"]
go-version: ["1.23", "1.22"]

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

Expand All @@ -49,12 +49,9 @@ jobs:

- name: Check test coverage
run: |
coverage=$(go tool cover -func=coverage.out | grep total | awk '{print $NF}')
echo "Test coverage: $coverage"
if (( $(echo "$coverage < 95" | bc -l) )); then
echo "ERROR: Coverage is below 95% threshold"
exit 1
fi
coverage=$(go tool cover -func=coverage.out | grep total | awk '{print $NF}' | tr -d '%')
echo "Test coverage: ${coverage}%"
awk -v cov="$coverage" 'BEGIN { if (cov+0 < 95) { print "ERROR: Coverage is below 95% threshold"; exit 1 } }'

- name: Display coverage report
run: go tool cover -html=coverage.out -o coverage.html
Expand All @@ -81,9 +78,9 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.25"
go-version: "1.23"

- name: Run go vet on auth package
run: go vet ./internal/auth/...
Loading