zuul-jobs/zuul.d/go-jobs.yaml
Mohammed Naser 23236c12fa golangci-lint: add job
This patch adds a roles and jobs to run golangci-lint against a
a Golang project.  It's a very popular tool for linting go code.

It also adds a simple framework which allows us to create dynamic
tests for file comments by defining a simple YAML file.

Change-Id: Ic8358541adaf7c3279383f0279cd3da7b446a6e0
2020-04-01 17:30:55 -04:00

101 lines
2.0 KiB
YAML

# Jobs listed in go-jobs.rst.
- job:
name: golang-go
parent: unittests
description: |
Base job for go operations
Responds to these variables:
.. zuul:jobvar:: go_command
:default: build
Command to pass to go.
.. zuul:jobvar:: go_package_dir
Path to go package to test
.. zuul:jobvar:: go_install_dir
:default: /usr/local/
Path to install go in
.. zuul:jobvar:: go_version
:default: 1.13
The version of go to use.
.. zuul:jobvar:: go_os
:default: {{ ansible_system | lower }}
OS to use when choosing go version.
.. zuul:jobvar:: go_arch
:default: amd64 / 386
Architecture to use when choosing go version
.. zuul:jobvar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
Path to operate in.
pre-run: playbooks/go/pre.yaml
run: playbooks/go/run.yaml
vars:
go_command: build
- job:
name: golang-go-test
parent: golang-go
description: |
Base job for go operations
Responds to these variables:
.. zuul:jobvar:: go_command
:default: build
Command to pass to go.
.. zuul:jobvar:: go_package_dir
Path to go package to test
.. zuul:jobvar:: go_install_dir
:default: /usr/local/
Path to install go in
.. zuul:jobvar:: go_version
:default: 1.13
The version of go to use.
.. zuul:jobvar:: go_os
:default: {{ ansible_system | lower }}
OS to use when choosing go version.
.. zuul:jobvar:: go_arch
:default: amd64 / 386
Architecture to use when choosing go version
.. zuul:jobvar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
Path to operate in.
vars:
go_command: test
- job:
name: golangci-lint
parent: unittests
description: |
Run golangci-lint on a Go project
pre-run: playbooks/golangci-lint/pre.yaml
run: playbooks/golangci-lint/run.yaml