diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6d0663a7..8d50d691 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,3 +12,27 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} version: latest args: --check . + go: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.22 + - name: Go vet (vulnerabilities) + run: go vet ./... + working-directory: ./tests/go + # FIXME: figure out why this is crashing with: Error: StdIn:1:1: expected 'package', found 'EOF' + # - name: Run gci (imports) + # run: | + # go install github.com/daixiang0/gci@latest + # gci diff --skip-generated --skip-vendor -s standard -s default . + # working-directory: ./tests/go + - name: Run golines (formatting) + run: | + go install mvdan.cc/gofumpt@latest + go install github.com/segmentio/golines@latest + golines --base-formatter=gofumpt --ignore-generated --tab-len=1 --max-len=120 --write . + working-directory: ./tests/go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d76b68c4..c7704f39 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,3 +23,15 @@ jobs: ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start - name: Run tests run: nvim --headless -c "PlenaryBustedDirectory test {minimal_init = 'tests/minimal_init.lua', sequential = true}" + go: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.22 + - name: Check tests + run: go test ./... + working-directory: ./tests/go