Release v1.8.1 #42
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: Test | |
# Controls when the workflow will run | |
on: [push, pull_request, workflow_dispatch] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains multiple jobs | |
# this job sets up the oldest version of go to check lang compatibility | |
CompatibilityCheck: | |
runs-on: ubuntu-20.04 | |
#Steps for the compatiblity test | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Go Environment | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.17.0' | |
- name: Check Go Version | |
run: go version | |
- name: Compiles | |
run: go build ./... | |
- name: Runs unit tests | |
if: ${{ success() }} | |
run: go test -coverprofile ./unitcoverage.out ./... | |
- name: Uploads artifacts | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
./unitcoverage.out | |
overwrite: true | |
# this job runs linux based tests | |
Linux: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-20.04 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Install Compose | |
uses: ndeloof/[email protected] | |
with: | |
version: v2.29.1 # pinned to 'latest' as of 06/08/2024 | |
legacy: true # will also install in PATH as `docker-compose` | |
- name: Setup Go environment | |
uses: actions/[email protected] | |
with: | |
go-version: '1.22' | |
check-latest: true | |
- name: Check Go Version | |
run: go version | |
- name: run go tool staticcheck | |
# use pinned version of staticcheck this need to match with the go version for compatibility | |
# Compatibility with go version is listed in the release description of https://github.com/dominikh/go-tools/releases | |
# need at least version v0.4.4 for go version 1.21 | |
run: | | |
go install honnef.co/go/tools/cmd/[email protected] | |
staticcheck -checks=all ./... | |
- name: Compiles | |
if: ${{ success() }} | |
run: go build ./... | |
- name: Runs go fmt | |
if: ${{ success() }} | |
run: | | |
OUTPUT=$(go fmt ./... 2>&1) | |
if [ ! -z "$OUTPUT" ]; then | |
echo "go fmt failed on the following files:" | |
echo "$OUTPUT" | |
exit 1 | |
fi | |
- name: Runs go vet | |
if: ${{ success() }} | |
run: | | |
OUTPUT=$(go vet ./... 2>&1) | |
if [ ! -z "$OUTPUT" ]; then | |
echo "go vet failed on the following:" | |
echo "$OUTPUT" | |
exit 1 | |
fi | |
- name: Runs staticcheck | |
if: ${{ success() }} | |
run: | | |
# use pinned version of the tool but check if this needs an update on go version bump | |
go install honnef.co/go/tools/cmd/[email protected] | |
OUTPUT=$(staticcheck --checks=all ./...) | |
if [ ! -z "$OUTPUT" ]; then | |
echo "staticcheck failed on the following:" | |
echo "$OUTPUT" | |
exit 1 | |
fi | |
- name: Runs unit tests | |
if: ${{ success() }} | |
run: go test -coverprofile ./unitcoverage.out ./... | |
- name: Generates the SEMPv2 client | |
if: ${{ success() }} | |
run: | | |
go generate . | |
working-directory: ./test/sempclient | |
- name: Runs the integration tests | |
if: ${{ success() }} | |
run: | | |
mkdir reports | |
go install github.com/onsi/ginkgo/v2/[email protected] | |
ginkgo --junit-report=./reports/report.xml -coverprofile ./reports/coverage.out -coverpkg solace.dev/go/messaging/internal/...,solace.dev/go/messaging/pkg/... -tags enable_debug_logging --label-filter='!flaky-test' | |
working-directory: ./test | |
- name: Uploads artifacts | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
./unitcoverage.out | |
./test/reports/report.xml | |
./test/reports/coverage.out | |
./test/diagnostics.tgz | |
overwrite: true | |