Initial backstage anc buildkite boilerplate #288
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Pull request checks | |
on: [pull_request] | |
jobs: | |
gomod: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: get go version | |
run: | | |
gv=$(cat .go-version) | |
echo "go=$gv" >> $GITHUB_OUTPUT | |
id: version | |
- name: install Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: "${{steps.version.outputs.go}}" | |
- name: check go.mod | |
# tidy go mod and check for differences | |
run: "go mod tidy && git diff --exit-code" | |
gofmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: get go version | |
run: | | |
gv=$(cat .go-version) | |
echo "go=$gv" >> $GITHUB_OUTPUT | |
id: version | |
- name: install Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: "${{steps.version.outputs.go}}" | |
- name: check format | |
# exit with 0 only if gofmt returns 0 lines | |
run: "exit $(gofmt | wc -l)" | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: get go version | |
run: | | |
gv=$(cat .go-version) | |
echo "go=$gv" >> $GITHUB_OUTPUT | |
id: version | |
- name: install Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: "${{steps.version.outputs.go}}" | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v2 | |
with: | |
version: v1.51.2 | |
license: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: get go version | |
run: | | |
gv=$(cat .go-version) | |
echo "go=$gv" >> $GITHUB_OUTPUT | |
id: version | |
- name: install Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: "${{steps.version.outputs.go}}" | |
- name: check license | |
# -d returns files without proper header | |
run: | | |
GOBIN=$PWD/bin go install github.com/elastic/go-licenser@latest | |
./bin/go-licenser -license Elasticv2 -d | |
fragments: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: get go version | |
run: | | |
gv=$(cat .go-version) | |
echo "go=$gv" >> $GITHUB_OUTPUT | |
id: version | |
- name: install Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: "${{steps.version.outputs.go}}" | |
- name: check fragments | |
run: | | |
make build | |
./elastic-agent-changelog-tool pr-has-fragment --repo elastic-agent-changelog-tool ${{github.event.number}} |