Skip to content

Commit

Permalink
add: ci jobs (#37)
Browse files Browse the repository at this point in the history
* add: lint job

* add: test workflow
  • Loading branch information
JulianToledano authored Jan 5, 2025
1 parent 861d6ce commit 01f5805
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint

on:
push:
branches: [ main ]
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.4'
cache: true

- name: lint
run: make lint
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Unit Tests

on:
push:
branches: [ main ]
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.4'
cache: true

- name: Run unit tests
run: make test
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ run:
tests: true
timeout: 15m
allow-parallel-runners: true
build-tags:
- e2e
- ledger
- test_ledger_mock

linters:
disable-all: true
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ ifneq ($(golangci_installed_version),$(golangci_version))
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
endif

lint:
@echo "--> Running linter"
$(MAKE) lint-install
@./scripts/lint-all.sh

lint-fix:
@echo "--> Running linter"
$(MAKE) lint-install
@./scripts/lint-all.sh --fix


test:
@echo "--> Running tests"
@go test ./... -v

0 comments on commit 01f5805

Please sign in to comment.