Skip to content

Commit

Permalink
ci: added unit tests to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Feb 9, 2024
1 parent 4360adf commit 367f380
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
permissions:
contents: read
jobs:
interceptor:
build:
name: Build
runs-on: ubuntu-latest
steps:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: unit-test
on:
push:
branches: [main]
pull_request:
paths:
- '**.go'
permissions:
contents: read
jobs:
test:
name: Unit Test go-codegen
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- uses: actions/checkout@v4
- name: Unit Test go-codegen
run: make unit-test
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ build:
@echo "Building go-codegen..."
@go build -o $(BUILD_DIR)/go-codegen main.go
@echo "Build complete!"

.PHONY: unit-test

unit-test:
@echo "Running unit tests..."
@go test -v -mod=readonly ./...
@echo "Unit tests complete!"

0 comments on commit 367f380

Please sign in to comment.