Skip to content

feat: alpha version #117

feat: alpha version

feat: alpha version #117

Workflow file for this run

name: Node Pool CI
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Lint and Test Go Code
runs-on:
- ubuntu-latest
env:
GOPRIVATE: github.com/gateway-fm/generic-rpc
GO111MODULE: on
steps:
- name: Check out code
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Configure git for private modules
env:
TOKEN: ${{ secrets.PROXY_PIPELINES_GITHUB_TOKEN }}
run: git config --global url."https://oauth2:${TOKEN}@github.com/gateway-fm".insteadOf "https://github.com/gateway-fm"
# Required by golangci-lint, according to docs
- name: Setup Golang Environment
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version-file: go.mod
cache: true
- run: |
go version
go clean -modcache
go mod tidy
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.52
skip-cache: true
skip-build-cache: true
skip-pkg-cache: true
skip-go-installation: true
args: --timeout=10m
- name: run tests and generate coverage
run: go test ./... -coverprofile=./cover.out
- name: check test coverage
id: coverage ## this step must have id
uses: vladopajic/go-test-coverage@v2
with:
profile: cover.out
local-prefix: github.com/org/project
threshold-file: 30
threshold-package: 30
threshold-total: 30
- name: make coverage badge
uses: action-badges/[email protected]
if: contains(github.ref, 'main')
with:
label: coverage
message: ${{ steps.coverage.outputs.badge-text }}
message-color: ${{ steps.coverage.outputs.badge-color }}
file-name: coverage.svg
badge-branch: badges ## orphan branch where badge will be committed
github-token: "${{ secrets.GITHUB_TOKEN }}"
release:
name: Make Release
needs:
- test
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.tag_version.outputs.new_tag }}
steps:
- uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.RELEASES_ACTION_GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
token: ${{ secrets.RELEASES_ACTION_GITHUB_TOKEN }}