Skip to content

Removing system prompt editing from copilot.go (#140) #366

Removing system prompt editing from copilot.go (#140)

Removing system prompt editing from copilot.go (#140) #366

Workflow file for this run

name: Go Build and Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build-and-test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
defaults:
run:
working-directory: ./
shell: bash # Forces Git Bash on Windows, standard Bash on Linux
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go Environment
uses: actions/setup-go@v5
with:
go-version: '1.26'
cache-dependency-path: go.sum
- name: Verify Module Dependencies
run: go mod verify
- name: Download Dependencies
run: go mod download
# Only build full Web UI on Linux to save time/resources on Windows
- name: Setup Node.js (for web UI build)
if: matrix.os == 'ubuntu-latest' && hashFiles('web/package.json') != ''
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Build Web UI
if: matrix.os == 'ubuntu-latest' && hashFiles('web/package.json') != ''
working-directory: web
run: npm ci && npm run build
# Bash syntax works on Windows runners too
- name: Ensure web/dist exists (stub for go:embed)
run: |
if [ ! -f web/dist/index.html ]; then
mkdir -p web/dist
echo '<!doctype html><html><head><title>waza</title></head><body>placeholder</body></html>' > web/dist/index.html
echo '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="80" font-size="80">w</text></svg>' > web/dist/favicon.svg
fi
- name: Format Check
if: matrix.os == 'ubuntu-latest'
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Go files must be formatted with gofmt:"
gofmt -l .
exit 1
fi
- name: Run Go Vet
run: go vet ./...
- name: Execute Tests
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload Coverage Report
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
flags: go-implementation
name: waza
- name: Build Binary
run: |
BINARY_NAME="waza"
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
BINARY_NAME="waza.exe"
fi
go build -v -o $BINARY_NAME ./cmd/waza
# Verify binary
chmod +x ./$BINARY_NAME
./$BINARY_NAME --version
- name: Integration Test
if: matrix.os == 'ubuntu-latest'
run: |
./waza run ./examples/code-explainer/eval.yaml --verbose
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go Environment
uses: actions/setup-go@v5
with:
go-version: '1.26'
# Required because golangci-lint might try to compile code that uses embed
- name: Ensure web/dist exists (stub for go:embed)
run: |
if [ ! -f web/dist/index.html ]; then
mkdir -p web/dist
echo '<!doctype html><html><head><title>waza</title></head><body>placeholder</body></html>' > web/dist/index.html
echo '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="80" font-size="80">w</text></svg>' > web/dist/favicon.svg
fi
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.10.1
working-directory: ./
args: --timeout=5m