Skip to content

Update actions, add linting, tweak runners #13

Update actions, add linting, tweak runners

Update actions, add linting, tweak runners #13

Workflow file for this run

name: NATS Server Tests
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
with:
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true
args: --timeout=5m --config=.golangci.yml
build:
name: Build (Go ${{ matrix.go }}, ${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
go: [stable, oldstable]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Build NATS Server
run: go build
# Note that the below testing steps depend on the Linux build
# only, as the Windows builds take a fair bit longer to set up.
build-windows:
name: Build (Go ${{ matrix.go }}, ${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
go: [stable, oldstable]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Build NATS Server
run: go build
js-no-cluster:
name: JetStream tests
needs: [build, lint]
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -run=TestJetStream ./server/... -tags=skip_js_cluster_tests,skip_js_cluster_tests_2,skip_js_cluster_tests_3,skip_js_super_cluster_tests -count=1 -vet=off -timeout=30m -failfast
js-cluster-1:
name: JetStream Cluster tests (1)
needs: [build, lint]
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -run=TestJetStreamCluster ./server/... -tags=skip_js_cluster_tests_2,skip_js_cluster_tests_3 -count=1 -vet=off -timeout=30m -failfast
js-cluster-2:
name: JetStream Cluster tests (2)
needs: [build, lint]
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -run=TestJetStreamCluster ./server/... -tags=skip_js_cluster_tests,skip_js_cluster_tests_3 -count=1 -vet=off -timeout=30m -failfast
js-cluster-3:
name: JetStream Cluster tests (3)
needs: [build, lint]
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -run=TestJetStreamCluster ./server/... -tags=skip_js_cluster_tests,skip_js_cluster_tests_2 -count=1 -vet=off -timeout=30m -failfast
js-supercluster:
name: JetStream Supercluster tests
needs: [build, lint]
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -run=TestJetStreamSuperCluster ./server/... -count=1 -vet=off -timeout=30m -failfast
no-race:
name: No-race tests
needs: [build, lint]
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -v -p=1 -run=TestNoRace ./... -count=1 -vet=off -timeout=30m -failfast
js-chaos:
name: JetStream chaos tests
if: ${{ false }} # Don't run for now
needs: [build, lint]
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -p=1 -run=TestJetStreamChaos ./server/... -tags=js_chaos_tests -count=1 -vet=off -timeout=30m -failfast
mqtt:
name: MQTT tests
needs: [build, lint]
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -run=TestMQTT ./server/... -count=1 -vet=off -timeout=30m -failfast
server-pkg-non-js:
name: Non-JetStream/MQTT tests
needs: [build, lint]
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -p=1 ./server/... -tags=skip_js_tests,skip_mqtt_tests -count=1 -vet=off -timeout=30m -failfast
non-server-pkg:
name: Tests from all other packages
needs: [build, lint]
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit tests
run: go test -race -v -p=1 ./conf/... ./internal/... ./logger/... ./test/... -count=1 -vet=off -timeout=30m -failfast