-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 2 KB
/
validate-example.yml
File metadata and controls
55 lines (46 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Example workflow for WireMock OpenAPI Validator
# This file demonstrates how to use the action in your repository
name: Validate WireMock Mappings
on:
workflow_dispatch: # Allow manual trigger
permissions:
contents: read
pull-requests: write # Required for PR comments
jobs:
validate:
name: Validate Mocks Against OpenAPI
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate WireMock Mappings
id: validate
uses: ./ # Use local action (change to your-org/wiremock-openapi-validator@v1 in production)
with:
openapi-path: "examples/OpenApiSpecs/PetStore.yml"
wiremock-path: "examples/WiremockMappings"
fail-on-warnings: false
post-comment: true
- name: Display Validation Summary
if: always()
run: |
echo "### 📊 Validation Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Total Checks**: ${{ steps.validate.outputs.total-checks }}" >> $GITHUB_STEP_SUMMARY
echo "- **Passed**: ✅ ${{ steps.validate.outputs.passed-checks }}" >> $GITHUB_STEP_SUMMARY
echo "- **Warnings**: ⚠️ ${{ steps.validate.outputs.warning-checks }}" >> $GITHUB_STEP_SUMMARY
echo "- **Failed**: ❌ ${{ steps.validate.outputs.failed-checks }}" >> $GITHUB_STEP_SUMMARY
echo "- **Errors**: 🔴 ${{ steps.validate.outputs.error-checks }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.validate.outputs.validation-passed }}" == "true" ]; then
echo "✅ **All validations passed!**" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Validation failed - see details above**" >> $GITHUB_STEP_SUMMARY
fi
- name: Upload Validation Results
if: always()
uses: actions/upload-artifact@v4
with:
name: validation-results
path: validation-results.json
retention-days: 30