Add an example for simple boolean logic (#84) #273
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.22.x' | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: go get ./... | |
- name: Run Unit tests | |
run: | | |
go test -v -covermode atomic -coverprofile="coverage.out" ./... | |
go tool cover -func="coverage.out" | |
lint: | |
name: Run linters | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.22.x' | |
- name: Install dependencies | |
run: | | |
go get ./... | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
go install github.com/gordonklaus/ineffassign@latest | |
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest | |
- name: Check format | |
run: | | |
if gofmt -e -l . >&1 | grep '^'; then | |
exit 1 | |
fi | |
- name: Lint with vet | |
run: go vet ./... | |
- name: Lint with staticcheck | |
run: staticcheck ./... | |
- name: Lint with ineffassign | |
run: ineffassign ./... | |
- name: Lint with gocyclo | |
run: gocyclo -over 15 . | |
examples: | |
name: Run examples | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.22.x' | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: go get ./... | |
- name: Build command line tool | |
run: go build ./cmd/bbn | |
- name: Run BBN examples | |
run: | | |
./bbn inference _examples/bbn/asia.yml | |
./bbn inference _examples/bbn/classifier.yml | |
./bbn inference _examples/bbn/dog-problem.xml | |
./bbn train _examples/bbn/fruits-untrained.yml _examples/bbn/fruits.csv | |
./bbn inference _examples/bbn/mendel.yml | |
./bbn inference _examples/bbn/monty-hall.yml | |
./bbn inference _examples/bbn/sprinkler.yml | |
- name: Run decision examples | |
run: | | |
./bbn inference _examples/decision/disease-control.yml | |
./bbn inference _examples/decision/earthquake.yml | |
./bbn inference _examples/decision/medical.yml | |
./bbn inference _examples/decision/oil.yml | |
./bbn inference _examples/decision/robot.yml | |
./bbn inference _examples/decision/test-selection.yml | |
./bbn inference _examples/decision/umbrella.yml | |
- name: Run logic examples | |
run: | | |
./bbn inference _examples/logic/bits.yml | |
./bbn inference _examples/logic/friends.yml | |
./bbn inference _examples/logic/knights.yml | |
./bbn inference _examples/logic/simple.yml | |
./bbn inference _examples/logic/weekday.yml |