get.pme.sh/pnats@v0.0.0-20240304004023-26bb5a137ed0/.github/workflows/MQTT_test.yaml (about) 1 name: MQTTEx 2 on: [push, pull_request] 3 4 permissions: 5 pull-requests: write # to comment on PRs 6 contents: write # to comment on commits (to upload artifacts?) 7 8 jobs: 9 test: 10 env: 11 GOPATH: /home/runner/work/nats-server 12 GO111MODULE: "on" 13 runs-on: ubuntu-latest 14 steps: 15 - name: Checkout code 16 uses: actions/checkout@v4 17 with: 18 path: src/github.com/nats-io/nats-server 19 20 - name: Setup Go 21 uses: actions/setup-go@v5 22 with: 23 go-version-file: src/github.com/nats-io/nats-server/go.mod 24 cache-dependency-path: src/github.com/nats-io/nats-server/go.sum 25 26 - name: Set up testing tools and environment 27 shell: bash --noprofile --norc -eo pipefail {0} 28 id: setup 29 run: | 30 wget https://github.com/hivemq/mqtt-cli/releases/download/v4.20.0/mqtt-cli-4.20.0.deb 31 sudo apt install ./mqtt-cli-4.20.0.deb 32 go install github.com/ConnectEverything/mqtt-test@4dd571c31318dcfebe5443242f53f262403ceafb 33 34 # - name: Download benchmark result for ${{ github.base_ref || github.ref_name }} 35 # uses: dawidd6/action-download-artifact@v2 36 # continue-on-error: true 37 # with: 38 # path: src/github.com/nats-io/nats-server/bench 39 # name: bench-output-${{ runner.os }} 40 # branch: ${{ github.base_ref || github.ref }} 41 42 - name: Run tests and benchmarks 43 shell: bash --noprofile --norc -eo pipefail {0} 44 run: | 45 cd src/github.com/nats-io/nats-server 46 go test -v --run='MQTTEx' ./server 47 # go test --run='-' --count=10 --bench 'MQTT_' ./server | tee output.txt 48 # go test --run='-' --count=10 --bench 'MQTTEx' --timeout=20m --benchtime=100x ./server | tee -a output.txt 49 go test --run='-' --count=3 --bench 'MQTTEx' --benchtime=100x ./server 50 51 # - name: Compare benchmarks 52 # uses: benchmark-action/github-action-benchmark@v1 53 # with: 54 # tool: go 55 # output-file-path: src/github.com/nats-io/nats-server/output.txt 56 # github-token: ${{ secrets.GITHUB_TOKEN }} 57 # alert-threshold: 140% 58 # comment-on-alert: true 59 # # fail-on-alert: true 60 # external-data-json-path: src/github.com/nats-io/nats-server/bench/benchmark-data.json 61 62 # - name: Store benchmark result for ${{ github.ref_name }} 63 # if: always() 64 # uses: actions/upload-artifact@v3 65 # with: 66 # path: src/github.com/nats-io/nats-server/bench 67 # name: bench-output-${{ runner.os }}