vaguerent/.github/workflows/go-testing.yml
2023-01-03 16:01:16 -08:00

54 lines
1.2 KiB
YAML

on:
push:
branches:
- main
- 'test-*'
paths:
- 'builtin/**'
- 'cmd/**'
- 'internal/**'
- '.github/workflows**'
- 'go.mod'
- 'go.sum'
pull_request:
branches:
- main
paths:
- 'builtin/**'
- 'cmd/**'
- 'internal/**'
- 'go.mod'
- 'go.sum'
jobs:
unit-tests-go:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['^1.16']
ruby: ['3.0', '3.1']
name: Vagrant unit tests on Go
steps:
- name: Code Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{matrix.go}}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- name: Get dependencies
run: |
git config --global url."https://${HASHIBOT_USERNAME}:${HASHIBOT_TOKEN}@github.com".insteadOf "https://github.com"
go get -v -t -d ./...
env:
HASHIBOT_USERNAME: ${{ secrets.HASHIBOT_USERNAME }}
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...