2021-07-15 02:51:32 +02:00
|
|
|
name: format
|
2022-03-10 09:54:38 +01:00
|
|
|
|
2021-07-15 02:51:32 +02:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-09-09 18:53:21 +02:00
|
|
|
- "rolling"
|
2022-04-02 12:22:32 +02:00
|
|
|
paths:
|
|
|
|
- 'lua/**'
|
|
|
|
- 'snapshots/**'
|
|
|
|
- 'tests/**'
|
|
|
|
- 'utils/**'
|
2021-07-15 02:51:32 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
stylua-check:
|
|
|
|
name: "Formatting check with Stylua"
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-10-15 18:32:11 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-07-15 02:51:32 +02:00
|
|
|
|
2021-09-09 18:53:21 +02:00
|
|
|
- name: Lint with stylua
|
2022-09-23 08:23:52 +02:00
|
|
|
uses: JohnnyMorganz/stylua-action@v1
|
2021-09-09 18:53:21 +02:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# CLI arguments
|
2022-10-07 04:51:09 +02:00
|
|
|
version: 0.15.1
|
2021-09-09 18:53:21 +02:00
|
|
|
args: --check .
|
2021-07-15 18:29:59 +02:00
|
|
|
|
2021-07-19 18:22:49 +02:00
|
|
|
shfmt-check:
|
|
|
|
name: "Formatting check with shfmt"
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-10-15 18:32:11 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-07-15 02:51:32 +02:00
|
|
|
|
2021-07-19 18:22:49 +02:00
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-09-09 18:53:21 +02:00
|
|
|
go-version: "1.16"
|
|
|
|
|
2021-07-19 18:22:49 +02:00
|
|
|
- name: Use shfmt
|
|
|
|
run: |
|
|
|
|
GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
|
|
|
|
|
2021-08-12 11:31:31 +02:00
|
|
|
# https://google.github.io/styleguide/shellguide.html
|
2021-07-19 18:22:49 +02:00
|
|
|
- name: Check formatting
|
2021-09-09 18:53:21 +02:00
|
|
|
run: make style-sh
|