Skip to content

Go Integration

Go Integration #1

Workflow file for this run

# Code generated by craft; DO NOT EDIT.
name: Go Integration
run-name: Go Integration
on:
- push
- workflow_dispatch
jobs:
version:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
version: ${{ steps.semantic_release.outputs.new_release_version }}
steps:
- uses: actions/checkout@v4
- id: sha
run: echo "sha=$(echo "${{ github.ref_name }}" | sha256sum | cut -c -8)" >> $GITHUB_OUTPUT
- id: semantic_release
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/commit-analyzer
@semantic-release/exec
@semantic-release/git
@semantic-release/github
@semantic-release/release-notes-generator
conventional-changelog-conventionalcommits
semantic-release-license
ci: false
dry_run: true
tag_format: v${version}
branches: |
[
"(master|main)",
"v+([0-9])?(.{+([0-9]),x}).x",
{ "name": "next", "prerelease": true },
{ "name": "beta", "prerelease": true },
{ "name": "alpha", "prerelease": true },
{ "name": "staging", "prerelease": "beta" },
{ "name": "develop", "prerelease": "alpha" },
{ "name": "${{ github.ref_name }}", "prerelease": "${{ steps.sha.outputs.sha }}" }
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo ${{ steps.semantic_release.outputs.new_release_version }}
go-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false
go-version-file: go.mod
token: ${{ secrets.GITHUB_TOKEN }}
- uses: golangci/golangci-lint-action@v4
with:
args: --config .golangci.yml --timeout 240s --fast --sort-results --out-format colored-line-number
go-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
token: ${{ secrets.GITHUB_TOKEN }}
- run: CGO_ENABLED="0" go test ./... -coverpkg=./... -covermode=count -coverprofile=coverage.out
- uses: codecov/codecov-action@v4
with:
disable_search: true
fail_ci_if_error: true
file: coverage.out
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}