Fix relation events, reset target on relation change, document subscr… #1285
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: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: Install dependencies | |
run: go get . | |
- name: Build Linux | |
run: GOOS=linux GOARCH=amd64 go build ./... | |
- name: Build Linux (tiny) | |
run: GOOS=linux GOARCH=amd64 go build -tags tiny ./... | |
- name: Build Windows | |
run: GOOS=windows GOARCH=amd64 go build ./... | |
- name: Build Windows (tiny) | |
run: GOOS=windows GOARCH=amd64 go build -tags tiny ./... | |
- name: Build MacOS | |
run: GOOS=darwin GOARCH=amd64 go build ./... | |
- name: Build MacOS (tiny) | |
run: GOOS=darwin GOARCH=amd64 go build -tags tiny ./... | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.21.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" | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
path-to-lcov: coverage.out | |
test_tiny: | |
name: Run tests (tiny) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.21.x' | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
go get . | |
- name: Run Unit tests (tiny) | |
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.21.x' | |
- name: Install dependencies | |
run: | | |
go get . | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
go install github.com/gordonklaus/ineffassign@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 vet (tiny) | |
run: go vet -tags tiny ./... | |
- name: Lint with staticcheck | |
run: staticcheck ./... | |
- name: Lint with staticcheck (tiny) | |
run: staticcheck -tags tiny ./... | |
- name: Lint with ineffassign | |
run: ineffassign ./... | |
semver: | |
name: Run SemVer check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: Install dependencies | |
run: | | |
go get . | |
go install golang.org/x/exp/cmd/gorelease@latest | |
- name: Get latest tag | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: latest-tag | |
- name: Run gorelease | |
run: gorelease -base=${{ steps.latest-tag.outputs.tag }} | |
examples: | |
name: Run Examples | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: Install dependencies | |
run: go get . | |
- name: Run examples | |
run: | | |
go run ./examples/base | |
go run ./examples/batch_ops | |
go run ./examples/events | |
go run ./examples/filter | |
go run ./examples/generic | |
go run ./examples/locked_world | |
go run ./examples/parallel | |
go run ./examples/random_access | |
go run ./examples/random_sampling | |
go run ./examples/readme | |
go run ./examples/relations | |
go run ./examples/resources | |
go run ./examples/systems | |
go run ./examples/world_stats | |
examples_tiny: | |
name: Run Examples (tiny) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: Install dependencies | |
run: go get . | |
- name: Run examples | |
run: | | |
go run -tags tiny ./examples/base | |
go run -tags tiny ./examples/batch_ops | |
go run -tags tiny ./examples/events | |
go run -tags tiny ./examples/filter | |
go run -tags tiny ./examples/generic | |
go run -tags tiny ./examples/locked_world | |
go run -tags tiny ./examples/parallel | |
go run -tags tiny ./examples/random_access | |
go run -tags tiny ./examples/random_sampling | |
go run -tags tiny ./examples/readme | |
go run -tags tiny ./examples/relations | |
go run -tags tiny ./examples/resources | |
go run -tags tiny ./examples/systems | |
go run -tags tiny ./examples/world_stats |