Skip to content

Merge pull request #1200 from vmware-samples/dependabot/go_modules/vm… #431

Merge pull request #1200 from vmware-samples/dependabot/go_modules/vm…

Merge pull request #1200 from vmware-samples/dependabot/go_modules/vm… #431

name: VMware Event Router Unit Tests
# triggered on every push and PRs but only when changes inside
# vmware-event-router (sub)dir(s)
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'vmware-event-router/**'
push:
paths:
- 'vmware-event-router/**'
# run all jobs with these defaults, unless specified otherwise
defaults:
run:
shell: bash
working-directory: ./vmware-event-router
jobs:
test:
name: Unit Tests
strategy:
matrix:
go-version: ["1.19"]
platform: ["ubuntu-latest"]
runs-on: ${{ matrix.platform }}
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go
- name: Install tparse
run: go install github.com/mfridman/tparse@latest
- name: run unit tests
run: make unit-test
- name: Verify git clean
shell: bash
run: |
if [[ -z "$(git status --porcelain)" ]]; then
echo "${{ github.repository }} up to date."
else
echo "${{ github.repository }} is dirty."
echo "::error:: $(git status)"
exit 1
fi