Skip to content

Commit

Permalink
Merge pull request #110 from isZumpo/unit_test_workflow
Browse files Browse the repository at this point in the history
Add unit test job
  • Loading branch information
tphakala authored Apr 7, 2024
2 parents 98ec6f4 + caee7f1 commit 6ec875e
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/golangci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: golangci-test
on:
push:
branches:
- main
pull_request:

jobs:
unit-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go version

- name: Install dependencies
run: make check-tensorflow

- name: Set environment variables for CGO
run: |
echo "CGO_ENABLED=1" >> $GITHUB_ENV
echo "CGO_CFLAGS=-I $HOME/src/tensorflow" >> $GITHUB_ENV
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest

- name: Run unit tests
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt -ci github
- name: Upload test log
uses: actions/upload-artifact@v2
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error

0 comments on commit 6ec875e

Please sign in to comment.