Skip to content

Commit

Permalink
Moving to Task based build system. (#122)
Browse files Browse the repository at this point in the history
# Describe Request

Moving to Task based build system.

# Change Type

Code maintenance.
  • Loading branch information
cinar committed Aug 18, 2024
1 parent 3634196 commit ed89bd2
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 49 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
48 changes: 0 additions & 48 deletions .github/workflows/go.yml

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/cinar/checker

go 1.20
go 1.22
28 changes: 28 additions & 0 deletions taskfile.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected] ./...
- go run honnef.co/go/tools/cmd/[email protected] ./...
- go run github.com/mgechev/[email protected] -config=revive.toml ./...

test:
cmds:
- go test -cover -coverprofile=coverage.out ./...

0 comments on commit ed89bd2

Please sign in to comment.