Moving to Task based build system. (#122)
# Describe Request Moving to Task based build system. # Change Type Code maintenance.
This commit is contained in:
parent
36341965fc
commit
ed89bd2960
4 changed files with 65 additions and 49 deletions
36
.github/workflows/ci.yml
vendored
Normal file
36
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: ./go.mod
|
||||
|
||||
- name: Setup cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Run task
|
||||
run: go run github.com/go-task/task/v3/cmd/task@v3.38.0
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v4.5.0
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
48
.github/workflows/go.yml
vendored
48
.github/workflows/go.yml
vendored
|
|
@ -1,48 +0,0 @@
|
|||
# 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: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.20.5
|
||||
|
||||
- name: Go vet
|
||||
run: go vet ./...
|
||||
|
||||
- name: Run Gosec
|
||||
uses: securego/gosec@master
|
||||
with:
|
||||
args: ./...
|
||||
|
||||
- name: Run Revive
|
||||
uses: docker://morphy/revive-action:v2
|
||||
|
||||
- name: Go fix
|
||||
run: go fix ./...
|
||||
|
||||
- name: Go build
|
||||
run: go build -v ./...
|
||||
|
||||
- name: Go test
|
||||
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
2
go.mod
2
go.mod
|
|
@ -1,3 +1,3 @@
|
|||
module github.com/cinar/checker
|
||||
|
||||
go 1.20
|
||||
go 1.22
|
||||
|
|
|
|||
28
taskfile.yml
Normal file
28
taskfile.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
version: '3'
|
||||
output: 'prefixed'
|
||||
|
||||
tasks:
|
||||
default:
|
||||
cmds:
|
||||
- task: fmt
|
||||
- task: lint
|
||||
- task: test
|
||||
|
||||
action:
|
||||
deps: [lint, test]
|
||||
|
||||
fmt:
|
||||
cmds:
|
||||
- go fix ./...
|
||||
|
||||
lint:
|
||||
cmds:
|
||||
- go vet ./...
|
||||
- go run github.com/securego/gosec/v2/cmd/gosec@v2.20.0 ./...
|
||||
- go run honnef.co/go/tools/cmd/staticcheck@v0.5.1 ./...
|
||||
- go run github.com/mgechev/revive@v1.3.4 -config=revive.toml ./...
|
||||
|
||||
test:
|
||||
cmds:
|
||||
- go test -cover -coverprofile=coverage.out ./...
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue