Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]

permissions:
contents: read

jobs:
test:
name: test (go ${{ matrix.go }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# The module declares go 1.19; test the floor and the latest stable.
go: ['1.19', 'stable']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: go vet
run: go vet ./...
- name: go test
run: go test ./...
- name: go test -race
run: go test -race ./...

benchmarks:
name: benchmarks compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Compile in-package benchmarks
# -bench='^$' matches no benchmark, so nothing runs, but the test binary
# (including every Benchmark* function) is still compiled.
run: go test -run='^$' -bench='^$' ./...
- name: Vet and compile cross-library benchmarks
working-directory: benchmarks
run: |
go vet ./...
go test -run='^$' -bench='^$' ./...

autobahn:
name: autobahn conformance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Autobahn fuzzing client
working-directory: autobahn
run: docker compose up --build --abort-on-container-exit
- name: Check conformance report
working-directory: autobahn
run: python3 check_report.py
- name: Upload Autobahn report
if: always()
uses: actions/upload-artifact@v4
with:
name: autobahn-report
path: autobahn/report/
if-no-files-found: warn
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@

# Dependency directories (remove the comment below to include it)
# vendor/

# Generated Autobahn|Testsuite conformance report
autobahn/report/

# Python bytecode (e.g. from autobahn/check_report.py)
__pycache__/
*.pyc
Binary file modified GoWest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# gowest developer tasks. Run `make help` for a summary.

.PHONY: help test race vet bench-compile bench check autobahn autobahn-down clean

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'

test: ## Run the test suite
go test ./...

race: ## Run the test suite under the race detector
go test -race ./...

vet: ## Run go vet
go vet ./...

bench-compile: ## Compile (but do not run) both benchmark suites
go test -run='^$$' -bench='^$$' ./...
cd benchmarks && go vet ./... && go test -run='^$$' -bench='^$$' ./...

bench: ## Run the cross-library echo benchmarks
cd benchmarks && go test -run='^$$' -bench=BenchmarkEcho -benchmem -count=6 .

check: vet test race bench-compile ## Run everything CI runs

autobahn: ## Run the Autobahn conformance suite (requires Docker)
cd autobahn && docker compose up --build --abort-on-container-exit
@echo "Report written to autobahn/report/index.html"

autobahn-down: ## Tear down the Autobahn containers
cd autobahn && docker compose down

clean: ## Remove generated artefacts
rm -rf autobahn/report
go clean ./...
Loading
Loading