Skip to content

Commit

Permalink
feat: Installation and run of MCVS-texttidy to check for forbidden wo…
Browse files Browse the repository at this point in the history
…rds in projects (#156)
  • Loading branch information
sbp-bvanb authored Jan 6, 2025
1 parent 0a6b698 commit 5e14579
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 11 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,29 @@ jobs:
MCVS-golang-action:
strategy:
matrix:
testing-type:
- component
- coverage
- integration
- lint
- security-golang-modules
- security-grype
- security-trivy
- unit
args:
- { testing-type: "component" }
- { testing-type: "coverage" }
- { testing-type: "integration" }
- { testing-type: "lint", build-tags: "component" }
- { testing-type: "lint", build-tags: "e2e" }
- { testing-type: "lint", build-tags: "integration" }
- { testing-type: "mcvs-texttidy" }
- { testing-type: "security-golang-modules" }
- { testing-type: "security-grype" }
- { testing-type: "security-trivy" }
- { testing-type: "unit" }
runs-on: ubuntu-22.04
env:
TASK_X_REMOTE_TASKFILES: 1
steps:
- uses: actions/[email protected]
- uses: schubergphilis/[email protected]
with:
build-tags: ${{ matrix.args.build-tags }}
golang-unit-tests-exclusions: |-
\(cmd\/some-app\|internal\/app\/some-app\)
testing-type: ${{ matrix.testing-type }}
testing-type: ${{ matrix.args.testing-type }}
token: ${{ secrets.GITHUB_TOKEN }}
```

Expand Down
22 changes: 21 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ vars:
GOVULNCHECK_VERSION: v1.1.3
GQLGENC_VERSION: v0.25.4
HELM_VERSION: v3.16.2
MOCKERY_BIN: "{{.GOPATH}}/bin/mockery"
MCVS_TEXTTIDY_BIN: "{{.GOBIN}}/mcvs-texttidy"
MCVS_TEXTTIDY_VERSION: 0.1.0
MOCKERY_BIN: "{{.GOBIN}}/mockery"
MOCKERY_MAJOR_VERSION: v2
MOCKERY_VERSION: "{{.MOCKERY_MAJOR_VERSION}}.46.0"
OPA_FMT: "{{.GOBIN}}/opa fmt ."
Expand Down Expand Up @@ -235,6 +237,24 @@ tasks:
deps:
- task: gci
- task: golangci-lint
mcvs-texttidy-install:
silent: true
cmds:
- |
if ! {{.MCVS_TEXTTIDY_BIN}} --version | grep -q {{.MCVS_TEXTTIDY_VERSION}}; then
go install github.com/schubergphilis/mcvs-texttidy/cmd/mcvs-texttidy@{{.MCVS_TEXTTIDY_VERSION}}
fi
mcvs-texttidy-run:
silent: true
cmds:
- "{{.MCVS_TEXTTIDY_BIN}}"
mcvs-texttidy:
desc: |
Install and run mcvs-texttidy to check for forbidden words in projects.
silent: true
cmds:
- task: mcvs-texttidy-install
- task: mcvs-texttidy-run
mock-generate:
desc: generate mocks
silent: true
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ runs:
run: |
task remote:golangci-lint --yes
#
# Run MCVS-texttidy.
#
- name: mcvs-texttidy
if: inputs.testing-type == 'mcvs-texttidy'
shell: bash
run: |
task remote:mcvs-texttidy --yes
#
# Unit tests.
#
- name: unit tests
Expand Down

0 comments on commit 5e14579

Please sign in to comment.