vaguerent/.github/workflows/go-testing.yml
2022-04-25 12:24:16 -05:00

58 lines
1.3 KiB
YAML

on:
push:
branches:
- main
- 'test-*'
paths:
- 'builtin/**'
- 'cmd/**'
- 'internal/**'
- '.github/workflows**'
pull_request:
branches:
- main
paths:
- 'builtin/**'
- 'cmd/**'
- 'internal/**'
jobs:
unit-tests:
runs-on: ubuntu-18.04
strategy:
matrix:
go: ['^1.15']
ruby: ['2.7', '3.0']
name: Vagrant unit tests on Go
steps:
- name: Code Checkout
uses: actions/checkout@v2
with:
path: main
- name: Get vagrant-plugin-sdk
uses: actions/checkout@v2
with:
repository: hashicorp/vagrant-plugin-sdk
path: vagrant-plugin-sdk
ref: main
token: ${{ secrets.HASHIBOT_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{matrix.go}}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
architecture: 'x64'
- name: Setup ruby vagrant
run: |
gem install --no-document bundler
cd main && bundle install
- name: Get dependencies
run: cd main && go get -v -t -d ./...
- name: Vet
run: cd main && go vet ./...
- name: Test
run: cd main && go test ./...