mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
110 lines
2.1 KiB
YAML
110 lines
2.1 KiB
YAML
name: Go
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- 'support/*'
|
|
pull_request: {}
|
|
|
|
jobs:
|
|
build-test:
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ macos-latest, ubuntu-latest ]
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 1.x
|
|
|
|
- run: go build ./...
|
|
|
|
- run: go test -v -race ./...
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 1.x
|
|
|
|
- uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: latest
|
|
only-new-issues: true
|
|
|
|
vet:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 1.x
|
|
|
|
- run: go vet ./...
|
|
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 1.x
|
|
|
|
- name: Run gofmt -d .
|
|
run: |
|
|
fmtvar="$(gofmt -d .)"
|
|
echo "$fmtvar"
|
|
test -z "$fmtvar"
|
|
|
|
modtidy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 1.x
|
|
|
|
- name: Run go mod tidy
|
|
run: |
|
|
go mod tidy
|
|
gitdiff="$(git diff -U0)"
|
|
echo "$gitdiff"
|
|
test -z "$gitdiff"
|
|
|
|
vendor-diff:
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 1.x
|
|
|
|
- name: Checkout base commit
|
|
uses: actions/checkout@v6
|
|
with:
|
|
path: a
|
|
ref: ${{ github.base_ref }}
|
|
- name: Download dependencies of base commit
|
|
run: go mod vendor
|
|
working-directory: a
|
|
|
|
- name: Checkout PR
|
|
uses: actions/checkout@v6
|
|
with:
|
|
path: b
|
|
- name: Download dependencies of PR
|
|
run: go mod vendor
|
|
working-directory: b
|
|
|
|
- name: Diff of dependencies
|
|
run: diff -ur --color=always a/vendor b/vendor || true
|