Merge pull request #15 from SolaceDev/dev #25
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@v2 | |
with: | |
path: | | |
./unitcoverage.out | |
# 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: Setup Go environment | |
uses: actions/setup-go@v2.1.3 | |
with: | |
go-version: '1.21' | |
check-latest: true | |
- name: Check Go Version | |
run: go version | |
- name: Compiles | |
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 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/ginkgo@v2.1.3 | |
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 | |
working-directory: ./test | |
- name: Uploads artifacts | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
path: | | |
./unitcoverage.out | |
./test/reports/report.xml | |
./test/reports/coverage.out | |
./test/diagnostics.tgz | |