Skip to content

Merge pull request #185 from ByteTheCookies/fix/v1.3.1 #173

Merge pull request #185 from ByteTheCookies/fix/v1.3.1

Merge pull request #185 from ByteTheCookies/fix/v1.3.1 #173

Workflow file for this run

# This workflow will build and test the Go server and client
# based on the project Justfile targets.
name: Go Build & Test
on:
push:
branches: ["main", "dev"]
paths:
- "cookiefarm/**"
- ".github/workflows/go.yml"
pull_request:
branches: ["main", "dev"]
paths:
- "cookiefarm/**"
- ".github/workflows/go.yml"
jobs:
build-server:
name: Build Server
runs-on: ubuntu-latest
defaults:
run:
working-directory: cookiefarm
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.26.1'
- name: Build server
run: go build -o ./bin/server ./server/main.go
- name: Build server plugins
run: |
for file in $(find ./pkg/protocols -name '*.go' ! -name 'protocols.go'); do
if grep -q '^package main' "$file"; then
filename=$(basename "$file")
pluginname=${filename%.go}
go build -buildmode=plugin -o "./pkg/protocols/$pluginname.so" "$file"
else
echo "Skipping $file: not a main package"
fi
done
build-client:
name: Build Client
runs-on: ubuntu-latest
defaults:
run:
working-directory: cookiefarm
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.26.1'
- name: Build client
run: go build -o ./bin/client ./client/main.go