format.yaml 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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@v2
  17. - name: Lint with stylua
  18. uses: JohnnyMorganz/stylua-action@1.0.0
  19. with:
  20. token: ${{ secrets.GITHUB_TOKEN }}
  21. # CLI arguments
  22. args: --check .
  23. shfmt-check:
  24. name: "Formatting check with shfmt"
  25. runs-on: ubuntu-20.04
  26. steps:
  27. - uses: actions/checkout@v2
  28. - name: Setup Go
  29. uses: actions/setup-go@v2
  30. with:
  31. go-version: "1.16"
  32. - name: Use shfmt
  33. run: |
  34. GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
  35. # https://google.github.io/styleguide/shellguide.html
  36. - name: Check formatting
  37. run: make style-sh