Skip to content

Commit

Permalink
ci(github): add unit tests to the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Gągor committed Dec 28, 2024
1 parent d806fce commit e59d6ab
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/build-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,35 @@ jobs:
./bin/*
args: -fq

- name: Unit Tests
run: |
go test -v ./...
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.binary }}
path: bin/*

unit-tests:
name: run unit tests
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup GoLang
uses: actions/setup-go@v5
with:
go-version: '~1.22.2'

- uses: actions/download-artifact@v4
with:
name: td-linux-amd64
path: .

- name: Run Unit Tests
run: |
go test -v ./...
smoke-tests:
name: test on ${{ matrix.os }}
needs:
Expand Down Expand Up @@ -155,6 +175,7 @@ jobs:
permissions: write-all
runs-on: ubuntu-latest
needs:
- unit-tests
- smoke-tests
- build
if: github.ref == 'refs/heads/main'
Expand Down

0 comments on commit e59d6ab

Please sign in to comment.