Update go.mod to use Go v1.21 toolchain #2988
Workflow file for this run
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: MQTTEx | |
on: [push, pull_request] | |
permissions: | |
pull-requests: write # to comment on PRs | |
contents: write # to comment on commits (to upload artifacts?) | |
jobs: | |
test: | |
env: | |
GOPATH: /home/runner/work/nats-server | |
GO111MODULE: "on" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
path: src/github.com/nats-io/nats-server | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: src/github.com/nats-io/nats-server/go.mod | |
cache-dependency-path: src/github.com/nats-io/nats-server/go.sum | |
- name: Set up testing tools and environment | |
shell: bash --noprofile --norc -eo pipefail {0} | |
id: setup | |
run: | | |
wget https://github.com/hivemq/mqtt-cli/releases/download/v4.20.0/mqtt-cli-4.20.0.deb | |
sudo apt install ./mqtt-cli-4.20.0.deb | |
go install github.com/ConnectEverything/mqtt-test@4dd571c31318dcfebe5443242f53f262403ceafb | |
# - name: Download benchmark result for ${{ github.base_ref || github.ref_name }} | |
# uses: dawidd6/action-download-artifact@v2 | |
# continue-on-error: true | |
# with: | |
# path: src/github.com/nats-io/nats-server/bench | |
# name: bench-output-${{ runner.os }} | |
# branch: ${{ github.base_ref || github.ref }} | |
- name: Run tests and benchmarks | |
shell: bash --noprofile --norc -eo pipefail {0} | |
run: | | |
cd src/github.com/nats-io/nats-server | |
go test -v --run='MQTTEx' ./server | |
# go test --run='-' --count=10 --bench 'MQTT_' ./server | tee output.txt | |
# go test --run='-' --count=10 --bench 'MQTTEx' --timeout=20m --benchtime=100x ./server | tee -a output.txt | |
go test --run='-' --count=3 --bench 'MQTTEx' --benchtime=100x ./server | |
# - name: Compare benchmarks | |
# uses: benchmark-action/github-action-benchmark@v1 | |
# with: | |
# tool: go | |
# output-file-path: src/github.com/nats-io/nats-server/output.txt | |
# github-token: ${{ secrets.GITHUB_TOKEN }} | |
# alert-threshold: 140% | |
# comment-on-alert: true | |
# # fail-on-alert: true | |
# external-data-json-path: src/github.com/nats-io/nats-server/bench/benchmark-data.json | |
# - name: Store benchmark result for ${{ github.ref_name }} | |
# if: always() | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# path: src/github.com/nats-io/nats-server/bench | |
# name: bench-output-${{ runner.os }} |