build(deps): Bump the gomod group across 1 directory with 5 updates (… #319
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: Build | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- README.md | |
- LICENSE | |
- .gitignore | |
- .editorconfig | |
- .chartreleaser.yaml | |
- .github/workflows/*-helm.yaml | |
- helm/** | |
- version.yaml | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- README.md | |
- LICENSE | |
- .gitignore | |
- .editorconfig | |
- .chartreleaser.yaml | |
- .github/workflows/*-helm.yaml | |
- helm/** | |
- version.yaml | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.22 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get dependencies | |
run: | | |
export GO111MODULE=on | |
go get -v -t -d ./... | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
install-mode: binary | |
version: latest | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.22 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get dependencies | |
run: | | |
export GO111MODULE=on | |
go get -v -t -d ./... | |
- name: Build | |
run: | | |
export GO111MODULE=on | |
go mod download | |
GOOS=linux GOARCH=amd64 go build -o bin/hcloud-pricing-exporter-linux-amd64 main.go | |
GOOS=linux GOARCH=arm64 go build -o bin/hcloud-pricing-exporter-linux-arm64 main.go | |
GOOS=windows GOARCH=amd64 go build -o bin/hcloud-pricing-exporter-windows-amd64.exe main.go | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@master | |
with: | |
name: binaries | |
path: bin/ | |
test: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.22 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get dependencies | |
run: | | |
export GO111MODULE=on | |
go get -v -t -d ./... | |
- name: Run tests | |
env: | |
HCLOUD_API_TOKEN: ${{ secrets.HCLOUD_API_TOKEN }} | |
run: go test -v -race -covermode=atomic "-coverprofile=coverprofile.out" ./... | |
- name: Report coverage | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
file: coverprofile.out | |
fail_ci_if_error: true |