Files
mattermost/.github/workflows/tools-ci.yml
Jesse Hallam 791fc09b5d Test and lint mmgotool in CI (#38338)
* Fix the pre-existing lint failures in mmgotool

Nothing lints this module yet, so these accumulated: an unchecked Close on the
en.json write path, two unused walk parameters, a nil initialiser and three
redundant breaks. The Close is the only behaviour change -- en.json is
regenerated wholesale, so a failed flush would otherwise truncate it silently.

* Test and lint mmgotool in CI

tools-ci.yml only ever covered mattermost-govet, and each tool under tools/ is
its own Go module that the server and mmctl suites cannot reach -- so mmgotool
was tested and linted nowhere. Matrix both jobs over the two modules and give
mmgotool the Makefile and golangci config the matrix expects.
2026-09-04 20:35:33 +00:00

68 lines
1.8 KiB
YAML

name: Tools CI
on:
push:
branches:
- master
- release-*
pull_request:
paths:
- "tools/mattermost-govet/**"
- "tools/mmgotool/**"
- ".github/workflows/tools-ci.yml"
concurrency:
group: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.ref) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
check-style:
name: check-style (${{ matrix.tool }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
tool:
- mattermost-govet
- mmgotool
defaults:
run:
working-directory: tools/${{ matrix.tool }}
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: tools/${{ matrix.tool }}/go.mod
- name: Run check-style
run: make check-style
test:
name: Test (${{ matrix.tool }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
tool:
- mattermost-govet
- mmgotool
defaults:
run:
working-directory: tools/${{ matrix.tool }}
steps:
- name: Checkout mattermost project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: tools/${{ matrix.tool }}/go.mod
- name: Run tests
run: make test