format.yaml 948 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: format
  2. on:
  3. pull_request:
  4. branches:
  5. - "rolling"
  6. paths:
  7. - 'lua/**'
  8. - 'snapshots/**'
  9. - 'tests/**'
  10. - 'utils/**'
  11. jobs:
  12. stylua-check:
  13. name: "Formatting check with Stylua"
  14. runs-on: ubuntu-20.04
  15. steps:
  16. - uses: actions/checkout@v3
  17. - name: Lint with stylua
  18. uses: JohnnyMorganz/stylua-action@v1
  19. with:
  20. token: ${{ secrets.GITHUB_TOKEN }}
  21. # CLI arguments
  22. version: 0.15.1
  23. args: --check .
  24. shfmt-check:
  25. name: "Formatting check with shfmt"
  26. runs-on: ubuntu-20.04
  27. steps:
  28. - uses: actions/checkout@v3
  29. - name: Setup Go
  30. uses: actions/setup-go@v2
  31. with:
  32. go-version: "1.16"
  33. - name: Use shfmt
  34. run: |
  35. GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
  36. # https://google.github.io/styleguide/shellguide.html
  37. - name: Check formatting
  38. run: make style-sh