-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (78 loc) · 2.14 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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 CLI examples
run: |
./bbn sample _examples/sprinkler.yml
./bbn sample _examples/monty-hall.yml
./bbn sample _examples/asia.yml
./bbn sample _examples/native-fish.yml
./bbn sample _examples/mendel.yml
./bbn sample _examples/umbrella.yml
./bbn sample _examples/earthquake.yml
./bbn sample _examples/dog-problem.xml
./bbn train _examples/fruits-untrained.yml _examples/fruits.csv