|
54 | 54 | with:
|
55 | 55 | # to allow the invalid wrapper jar present in test data
|
56 | 56 | allow-checksums: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
| 57 | + min-wrapper-count: 10 |
57 | 58 |
|
58 | 59 | - name: Check outcome
|
59 | 60 | env:
|
|
98 | 99 | echo "'outputs.failed-wrapper' has unexpected content: $FAILED_WRAPPERS"
|
99 | 100 | exit 1
|
100 | 101 | fi
|
| 102 | +
|
| 103 | + test-validation-minimum-wrapper-count: |
| 104 | + runs-on: ubuntu-latest |
| 105 | + steps: |
| 106 | + - name: Checkout sources |
| 107 | + uses: actions/checkout@v4 |
| 108 | + - name: Initialize integ-test |
| 109 | + uses: ./.github/actions/init-integ-test |
| 110 | + |
| 111 | + - name: Run wrapper-validation-action |
| 112 | + id: action-test |
| 113 | + uses: ./wrapper-validation |
| 114 | + with: |
| 115 | + # to allow the invalid wrapper jar present in test data |
| 116 | + allow-checksums: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
| 117 | + min-wrapper-count: 11 |
| 118 | + # Expected to fail; validated below |
| 119 | + continue-on-error: true |
| 120 | + |
| 121 | + - name: Check outcome |
| 122 | + env: |
| 123 | + # Evaluate workflow expressions here as env variable values instead of inside shell script |
| 124 | + # below to not accidentally inject code into shell script or break its syntax |
| 125 | + VALIDATION_FAILED: ${{ steps.action-test.outcome == 'failure' }} |
| 126 | + run: | |
| 127 | + if [ "$VALIDATION_FAILED" != "true" ] ; then |
| 128 | + echo "Expected validation to fail, but it didn't" |
| 129 | + exit 1 |
| 130 | + fi |
| 131 | +
|
| 132 | + test-validation-zero-wrappers: |
| 133 | + runs-on: ubuntu-latest |
| 134 | + steps: |
| 135 | + - name: Checkout sources |
| 136 | + uses: actions/checkout@v4 # Checkout the repository with no wrappers |
| 137 | + with: |
| 138 | + sparse-checkout: | |
| 139 | + .github/actions |
| 140 | + dist |
| 141 | + wrapper-validation |
| 142 | + - name: Initialize integ-test |
| 143 | + uses: ./.github/actions/init-integ-test |
| 144 | + |
| 145 | + - name: Run wrapper-validation-action |
| 146 | + id: action-test |
| 147 | + uses: ./wrapper-validation |
| 148 | + # Expected to fail; validated below |
| 149 | + continue-on-error: true |
| 150 | + |
| 151 | + - name: Check outcome |
| 152 | + env: |
| 153 | + # Evaluate workflow expressions here as env variable values instead of inside shell script |
| 154 | + # below to not accidentally inject code into shell script or break its syntax |
| 155 | + VALIDATION_FAILED: ${{ steps.action-test.outcome == 'failure' }} |
| 156 | + run: | |
| 157 | + if [ "$VALIDATION_FAILED" != "true" ] ; then |
| 158 | + echo "Expected validation to fail, but it didn't" |
| 159 | + exit 1 |
| 160 | + fi |
0 commit comments