Skip to content

Commit ccff2e0

Browse files
committed
Merge branch 'v1.0.0'
2 parents 3e9a01b + c3d9618 commit ccff2e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4596
-1756
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Test binary
22
demoinfocs-golang.test
33
demoinfocs-golang.test.exe
4+
.vscode/

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
path = cs-demos
33
url = https://gitlab.com/markus-wa/cs-demos
44
branch = master
5-
[submodule "vendor"]
6-
path = vendor
7-
url = https://github.com/markus-wa/demoinfocs-golang-vendor.git
8-
branch = master

.golangci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
run:
2+
deadline: 5m
3+
build-tags:
4+
- debugdemoinfocs
5+
skip-dirs:
6+
- msg
7+
skip-files:
8+
- parser_interface.go
9+
- game_state_interface.go
10+
linters:
11+
enable-all: true
12+
disable:
13+
- gochecknoinits
14+
- gochecknoglobals
15+
- lll
16+
linters-settings:
17+
gocritic:
18+
disabled-checks:
19+
- ifElseChain

.travis.yml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,57 @@ language: go
22
sudo: required
33

44
go:
5-
- 1.9.x
5+
- 1.11.x
66
- stable
77
- master
88

9+
matrix:
10+
# Failing on the development version of Go isn't too bad.
11+
allow_failures:
12+
- go: master
13+
14+
env:
15+
- GO111MODULE=on
16+
17+
# Override Travis's default 'go get' step, since we use Go modules
918
install:
10-
# We need goverage to run go tests with -coverprofile for multiple packages
11-
- go get github.com/haya14busa/goverage
12-
# Download test data
13-
- pushd cs-demos && git lfs pull -I '*' && popd
19+
- go mod download
1420

1521
before_script:
16-
# We don't want to run the demo set test with race condition testing.
17-
# The demo set is large and race tests take a lot longer
18-
- race_tests=$(go test -list . | grep -v "TestDemoSet\|Benchmark" | head -n -1 | awk -vORS=\| '{ print $1 }' | sed 's/|$/\n/')
22+
# Install interface generator
23+
- GO111MODULE=off go get github.com/vburenin/ifacemaker
24+
25+
# Fetch refs for linter
26+
- git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
27+
- git fetch
28+
29+
# Install golangci-lint
30+
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.12.2
31+
32+
# Download test data
33+
- pushd cs-demos && git lfs pull -I '*' && popd
1934

2035
script:
36+
- go build ./...
37+
38+
# Make sure generated code is up-to-date
39+
- go generate
40+
- diff_output=$(git diff)
41+
- if [[ "$diff_output" != "" ]]; then echo "Generated code is not up-to-date" && echo "$diff_output" && exit 1; fi
42+
43+
# Lint changed code
44+
- if [[ "$TRAVIS_COMMIT_RANGE" != "" ]]; then commit_range=${TRAVIS_COMMIT_RANGE/.../..} && git diff $commit_range > /dev/null && base_rev=$commit_range || true; fi
45+
- if [[ "$base_rev" = "" ]]; then base_rev='origin/master'; fi && echo "Linting changes between/since $base_rev"
46+
- golangci-lint run --new-from-rev $base_rev
47+
48+
# Get list of tests to run with race detection.
49+
# We don't want to run the entire demo set with it because it's large and race tests take a lot longer.
50+
- race_tests=$(go test -list . | grep -v "TestDemoSet\|Benchmark" | head -n -1 | awk -vORS=\| '{ print $1 }' | sed 's/|$/\n/')
2151
# Run race tests
2252
- go test -v -race -run "$race_tests" -timeout 15m
53+
2354
# We run all tests again to get full coverage, technically unncecessary tho
24-
- goverage -v -timeout 30m -coverprofile=coverage.txt $(go list ./... | grep -v msg | awk -vORS=' ' '{ print $1 }')
55+
- go test -v -timeout 30m -coverprofile=coverage.txt -coverpkg=$(go list ./... | grep -v msg | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/') ./...
2556

2657
after_success:
2758
- bash <(curl -s https://codecov.io/bash)

Gopkg.lock

Lines changed: 0 additions & 78 deletions
This file was deleted.

Gopkg.toml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)