codegen.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: Codegen
  2. on:
  3. push:
  4. tags:
  5. - v*
  6. branches:
  7. - master
  8. - release-*
  9. pull_request:
  10. branches:
  11. - master
  12. - release-*
  13. defaults:
  14. run:
  15. # reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
  16. shell: bash --noprofile --norc -eo pipefail -x {0}
  17. # cancel the in-progress workflow when PR is refreshed.
  18. concurrency:
  19. group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
  20. cancel-in-progress: true
  21. permissions:
  22. contents: read
  23. jobs:
  24. codegen:
  25. runs-on: ubuntu-20.04
  26. if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')"
  27. steps:
  28. - name: checkout
  29. uses: actions/checkout@v4
  30. with:
  31. fetch-depth: 0
  32. - uses: actions/setup-go@v4
  33. with:
  34. go-version: "1.21"
  35. - name: run codegen
  36. run: GOPATH=$(go env GOPATH) make codegen
  37. - name: validate codegen
  38. run: tests/scripts/validate_modified_files.sh codegen