Skip to content

linting and coverage #5

linting and coverage

linting and coverage #5

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
env:
GO_VERSION: '1.23.1'
NODE_VERSION: '22.3.x'
on:
push:
pull_request:
branches: [ "master" ]
jobs:
linting:
name: Linting with golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install node modules
working-directory: ./frontend
run: npm install
- name: Build frontend
working-directory: ./frontend
run: npm run build
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
test-and-coverage:
name: Go test and coverage check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install node modules
working-directory: ./frontend
run: npm install
- name: Build frontend
working-directory: ./frontend
run: npm run build
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: generate test coverage
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yaml
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install node modules
working-directory: ./frontend
run: npm install
- name: Build frontend
working-directory: ./frontend
run: npm run build
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
run: go build -v ./...