Skip to content

Commit 249e9c5

Browse files
committed
Add unit testing steps to Linux and Windows build workflows
1 parent 77f683b commit 249e9c5

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

.github/workflows/go_build_linux.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
wget --no-verbose -O- https://github.com/VirusTotal/yara/archive/v${YARA_VERSION}.tar.gz | tar -C /tmp -xzf -
2828
( cd /tmp/yara-${YARA_VERSION} && ./bootstrap.sh && sudo ./configure && sudo make && sudo make install )
2929
- uses: actions/checkout@v2
30+
- name: Run Unit Tests
31+
run: |
32+
sudo ldconfig
33+
go test ./... -v
3034
- name: Building Fastfinder
3135
run: |
3236
go build -trimpath -tags yara_static -a -ldflags '-s -w -extldflags "-static"' .

.github/workflows/go_build_windows.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,29 @@ jobs:
3535
./configure --prefix=/mingw64 --enable-static --disable-shared
3636
make -j$(nproc)
3737
make install
38+
# Verify yara.pc installation
39+
ls -la /mingw64/lib/pkgconfig/yara.pc
40+
pkg-config --modversion yara
3841
- name: Set up Go
3942
uses: actions/setup-go@v2
4043
with:
4144
go-version: 1.24
4245
- uses: actions/checkout@v2
46+
- name: Run Unit Tests
47+
run: |
48+
export PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
49+
export CGO_CFLAGS="-I/mingw64/include"
50+
export CGO_LDFLAGS="-L/mingw64/lib"
51+
cd $GITHUB_WORKSPACE
52+
go test ./... -v
4353
- name: Building Fastfinder
44-
shell: powershell
4554
run: |
46-
$Env:PATH += ";C:/msys64/mingw64/include"
47-
$Env:PATH += ";C:/msys64/mingw64/lib"
48-
$Env:PATH += ";C:/msys64/mingw64/lib/pkgconfig"
49-
$Env:GOOS="windows"
50-
$Env:GOARCH="amd64"
51-
$Env:CGO_CFLAGS="-IC:/msys64/mingw64/include"
52-
$Env:CGO_LDFLAGS="-LC:/msys64/mingw64/lib -lyara -lcrypto"
53-
$Env:PKG_CONFIG_PATH="C:/msys64/mingw64/lib/pkgconfig"
54-
cd $Env:GITHUB_WORKSPACE
55+
export PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
56+
export CGO_CFLAGS="-I/mingw64/include"
57+
export CGO_LDFLAGS="-L/mingw64/lib"
58+
export GOOS="windows"
59+
export GOARCH="amd64"
60+
cd $GITHUB_WORKSPACE
5561
go build -trimpath -tags yara_static -a -ldflags '-s -w -extldflags "-static"' .
56-
ls
57-
.\fastfinder.exe -h
62+
ls -la fastfinder.exe
63+
./fastfinder.exe -h

0 commit comments

Comments
 (0)