Skip to content

Commit

Permalink
Merge pull request #124 from ccremer/ci-update
Browse files Browse the repository at this point in the history
Update CI workflows
  • Loading branch information
ccremer authored Sep 18, 2024
2 parents e48dacb + b60fa13 commit 364d223
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 33 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- uses: actions/cache@v4
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- uses: actions/cache@v4
with:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ jobs:
with:
fetch-depth: 0

- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -62,7 +59,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish releases
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
args: release --release-notes .github/release-notes.md
env:
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- uses: actions/cache@v4
with:
Expand All @@ -33,12 +30,3 @@ jobs:
- name: Run tests
run: make test

- name: Upload code coverage report to Code Climate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 38a41dde51e26878e774848c2654bba1082ad39703571505e877575b2a9695e3
with:
coverageLocations: cover.out:gocov
prefix: github.com/${{ github.repository }}

1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
version: 2
builds:
- env:
- CGO_ENABLED=0 # this is needed otherwise the Docker image build is faulty
Expand Down
4 changes: 0 additions & 4 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
# This is the config file for greposync that defines default values
# Visit the documentation at https://ccremer.github.io/greposync

.github/workflows/test.yml:
codeclimate:
reporterID: 38a41dde51e26878e774848c2654bba1082ad39703571505e877575b2a9695e3
4 changes: 1 addition & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ endif::[]

ifdef::status[]
image:https://img.shields.io/github/workflow/status/ccremer/fronius-exporter/Build/master[Build,link=https://github.com/ccremer/fronius-exporter/actions?query=workflow%3ABuild]
image:https://img.shields.io/codeclimate/maintainability/ccremer/fronius-exporter[Maintainability,link=https://codeclimate.com/github/ccremer/fronius-exporter]
image:https://img.shields.io/codeclimate/coverage/ccremer/fronius-exporter[Tests,link=https://codeclimate.com/github/ccremer/fronius-exporter]
image:https://img.shields.io/github/v/release/ccremer/fronius-exporter[Releases,link=https://github.com/ccremer/fronius-exporter/releases]
image:https://img.shields.io/github/license/ccremer/fronius-exporter[License,link=https://github.com/ccremer/fronius-exporter/blob/master/LICENSE]
endif::[]
Expand Down Expand Up @@ -106,7 +104,7 @@ Platform related builds are handled by `goreleaser`:
export GOOS=linux
export GOARCH=arm64
export IMAGE_REPOSITORY=ccremer/fronius-exporter
goreleaser build --snapshot --rm-dist --single-target
goreleaser build --snapshot --clean --single-target
----

On the other hand you can also use the actual `make build` in combination with `docker buildx`
Expand Down

0 comments on commit 364d223

Please sign in to comment.