forked from kaorimatz/resque_exporter
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Intellection/add_test_and_release_workflows
Add test and release workflows using GitHub Actions
- Loading branch information
Showing
5 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "[0-9].[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
github-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref_name }} | ||
release_name: Version ${{ github.ref_name }} | ||
draft: false | ||
prerelease: false | ||
|
||
release-binaries: | ||
runs-on: ubuntu-latest | ||
needs: github-release | ||
strategy: | ||
matrix: | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
exclude: | ||
- goarch: arm64 | ||
goos: windows | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Publish Go Binaries | ||
uses: wangyoucao577/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
ldflags: -X "main.tagVersion=${{ github.ref_name }}" | ||
extra_files: LICENSE README.md | ||
md5sum: true | ||
sha256sum: true | ||
asset_name: resque-exporter-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache: true | ||
cache-dependency-path: go.sum | ||
go-version-file: go.mod | ||
- name: Run Linter | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.62.0 | ||
|
||
unit-testing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache: true | ||
cache-dependency-path: go.sum | ||
go-version-file: go.mod | ||
- name: Build | ||
run: go build -v ./... | ||
- name: Run Tests | ||
run: go test -json ./... > test-results.json | ||
- name: Annotate Tests | ||
if: always() | ||
uses: guyarb/[email protected] | ||
with: | ||
test-results: test-results.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- govet | ||
- revive |
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
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