vaguerent/.github/workflows/go-spectest.yml
Paul Hinze 2efa6547f4
Updates to make vagrant-spec work in CI
* The vagrant-spec gem is installed as part of bundle install so
   there's no need to install it separately. Remove those extra steps
   and invoke it with bundle exec instead.
 * The binstub for vagrant does not work with `--standalone` in CI, but
   the one generated w/o `--standalone` works fine. This also seems to
   work in dev, so we'll just switch to that one.
 * Fetch all tags in CI to make sure we're getting proper version
   numbers in our build (based off `git describe`).
2022-04-25 12:26:50 -05:00

62 lines
1.7 KiB
YAML

on:
push:
branches:
- main
- 'test-*'
paths:
- 'builtin/**'
- 'cmd/**'
- 'internal/**'
- '.github/workflows**'
- 'go.mod'
- 'go.sum'
workflow_dispatch:
branches:
- 'main'
jobs:
vagrant-spec-tests:
runs-on: ubuntu-18.04
strategy:
matrix:
go: ['^1.16']
ruby: ['2.7']
name: Vagrant acceptance tests
steps:
- name: Code Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
# Also fetch all tags, since we need our version number in the build
# to be based off a tag
fetch-depth: 0
- 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}}
- name: Setup ruby vagrant
run: |
gem install --no-document bundler
bundle install
- name: Build Vagrant
run: |
git config --global url."https://${HASHIBOT_USERNAME}:${HASHIBOT_TOKEN}@github.com".insteadOf "https://github.com"
make bin/linux
env:
HASHIBOT_USERNAME: ${{ secrets.HASHIBOT_USERNAME }}
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
- name: Add binstubs to path
run: |
echo "$PWD/binstubs" >> $GITHUB_PATH
env:
VAGRANT_SPEC_BOX: "hashicorp/bionic64"
- name: Run vagrant-spec
run: |
VAGRANT_PATH="$GITHUB_WORKSPACE/vagrant" bundle exec vagrant-spec test --components=cli/version --config test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb
env:
VAGRANT_SPEC_BOX: "hashicorp/bionic64"