Skip to content

Commit

Permalink
Fix go linting workflow missing tensorflow dependency
Browse files Browse the repository at this point in the history
The workflow was failing to run since it did not have the
required tensorflow dependencie. This commit fixes it
by making use of the makefile to install the dependency inside
the workflow.
  • Loading branch information
isZumpo committed Apr 5, 2024
1 parent 4c839a3 commit 194c3e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ permissions:
# Optional: allow read access to pull request. Use with `only-new-issues` option.
#pull-requests: read

env:
CGO_ENABLED: '1'
CGO_CFLAGS : -I$(HOME)/src/tensorflow
LDFLAGS: -ldflags "-s -w"
GOOS: linux
GOARCH: amd64

jobs:
golangci:
name: lint
Expand All @@ -20,6 +27,9 @@ jobs:
with:
go-version-file: 'go.mod'
- run: go version

- name: Install dependencies
run: make deps_linux_amd64

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ $(LABELS_ZIP): $(LABELS_FILES)
@echo "Creating or updating labels.zip from contents of internal/birdnet/labels/*"
@cd internal/birdnet/labels && zip -j $(CURDIR)/$(LABELS_ZIP) *

# Install dependencies for Linux amd64
deps_linux_amd64: TFLITE_LIB_DIR="/usr/lib"
deps_linux_amd64: TFLITE_LIB_ARCH=tflite_c_$(TFLITE_VERSION)_linux_amd64.tar.gz
deps_linux_amd64: check-tools check-tensorflow download-tflite

# Build for Linux amd64
linux_amd64: TFLITE_LIB_DIR="/usr/lib"
linux_amd64: TFLITE_LIB_ARCH=tflite_c_$(TFLITE_VERSION)_linux_amd64.tar.gz
Expand Down

0 comments on commit 194c3e1

Please sign in to comment.