-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMPROVED] Move CI to github actions (#1623)
Signed-off-by: Piotr Piotrowski <[email protected]>
- Loading branch information
Showing
5 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Testing | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
|
||
- name: Install deps | ||
shell: bash --noprofile --norc -x -eo pipefail {0} | ||
run: | | ||
go get -t ./... | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
go install github.com/client9/misspell/cmd/misspell@latest | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
- name: Run linters | ||
shell: bash --noprofile --norc -x -eo pipefail {0} | ||
run: | | ||
$(exit $(go fmt -modfile=go_test.mod ./... | wc -l)) | ||
go vet -modfile=go_test.mod ./... | ||
GOFLAGS="-mod=mod -modfile=go_test.mod" staticcheck ./... | ||
find . -type f -name "*.go" | xargs misspell -error -locale US | ||
golangci-lint run --timeout 5m0s ./jetstream/... | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
go: [ "1.21", "1.22" ] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Install deps | ||
shell: bash --noprofile --norc -x -eo pipefail {0} | ||
run: | | ||
go install github.com/mattn/goveralls@latest | ||
go install github.com/wadey/gocovmerge@latest | ||
- name: Test and coverage | ||
shell: bash --noprofile --norc -x -eo pipefail {0} | ||
run: | | ||
go test -modfile=go_test.mod -v -run=TestNoRace -p=1 ./... --failfast -vet=off | ||
if [ "${{ matrix.go }}" = "1.22" ]; then | ||
./scripts/cov.sh CI | ||
else | ||
go test -modfile=go_test.mod -race -v -p=1 ./... --failfast -vet=off -tags=internal_testing | ||
fi | ||
- name: Coveralls | ||
if: matrix.go == '1.22' | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
file: acc.out |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Test nats-server@main | ||
on: | ||
schedule: | ||
- cron: "30 8 * * *" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
|
||
- name: Get latest server | ||
shell: bash --noprofile --norc -x -eo pipefail {0} | ||
run: | | ||
go get -modfile go_test.mod github.com/nats-io/nats-server/v2@main | ||
- name: Test | ||
shell: bash --noprofile --norc -x -eo pipefail {0} | ||
run: | | ||
go test -modfile=go_test.mod -v -run=TestNoRace -p=1 ./... --failfast -vet=off | ||
go test -modfile=go_test.mod -race -v -p=1 ./... --failfast -vet=off -tags=internal_testing |
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
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
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