|
3 | 3 | types: |
4 | 4 | - created |
5 | 5 | jobs: |
| 6 | + distgen-check: |
| 7 | + name: "Check distgen generated files" |
| 8 | + runs-on: ubuntu-20.04 |
| 9 | + if: | |
| 10 | + github.event.issue.pull_request |
| 11 | + && (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]')) |
| 12 | + && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) |
| 13 | + steps: |
| 14 | + - name: Checkout repo |
| 15 | + uses: actions/checkout@v2 |
| 16 | + with: |
| 17 | + ref: "refs/pull/${{ github.event.issue.number }}/head" |
| 18 | + submodules: true |
| 19 | + |
| 20 | + - name: Check distgen generated files |
| 21 | + id: check |
| 22 | + shell: bash |
| 23 | + run: | |
| 24 | + sha=$(git rev-parse HEAD) |
| 25 | + sudo apt update && sudo apt -y install python3-pip |
| 26 | + pip3 install distgen |
| 27 | + result="success" |
| 28 | + ./common/tests/check_distgen_generated_files.sh || result="failure" |
| 29 | + echo "result=$result" >> "$GITHUB_OUTPUT" |
| 30 | + echo "sha=$sha" >> "$GITHUB_OUTPUT" |
| 31 | +
|
| 32 | + - name: Set final commit status |
| 33 | + uses: myrotvorets/[email protected] |
| 34 | + with: |
| 35 | + status: ${{ steps.check.outputs.result }} |
| 36 | + context: "Distgen check" |
| 37 | + sha: ${{ steps.check.outputs.sha }} |
| 38 | + |
| 39 | + - name: Exit on ERR |
| 40 | + shell: bash |
| 41 | + run: | |
| 42 | + _result=${{ steps.check.outputs.result }} |
| 43 | + if [ "$_result" == failure ]; then |
| 44 | + echo "Distgen-generated files are not regenerated properly." |
| 45 | + echo "Please regenerate them with:" |
| 46 | + echo "'make clean-versions'" |
| 47 | + echo "'make generate-all'" |
| 48 | + exit 1 |
| 49 | + fi |
6 | 50 | container-tests: |
| 51 | + needs: distgen-check |
7 | 52 | # This job only runs for '[test]' pull request comments by owner, member |
8 | 53 | runs-on: ubuntu-20.04 |
9 | 54 | name: "Container tests: ${{ matrix.version }} - ${{ matrix.context }}" |
|
0 commit comments