diff --git a/.github/workflows/go-spectest.yml b/.github/workflows/go-spectest.yml new file mode 100644 index 000000000..f0709faf1 --- /dev/null +++ b/.github/workflows/go-spectest.yml @@ -0,0 +1,67 @@ +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: + tests: + runs-on: ubuntu-18.04 + strategy: + matrix: + go: ['^1.16'] + ruby: ['3.0'] + name: Vagrant acceptance tests + steps: + - name: Code Checkout + uses: actions/checkout@v2 + - 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 + 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: Code vagrant-spec repo + uses: actions/checkout@v2 + with: + repository: 'hashicorp/vagrant-spec' + path: vagrant-spec + - name: Install vagrant-spec + run: | + gem build vagrant-spec/vagrant-spec.gemspec + gem install vagrant-spec/vagrant-spec*.gem + - name: Run spec tests + run: | + vagrant-spec test --components=cli/box cli/plugin cli/version cli/init --config test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb + env: + VAGRANT_SPEC_BOX: "hashicorp/bionic64" diff --git a/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb b/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb index e83fe81cd..01a1f518a 100644 --- a/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb +++ b/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb @@ -5,6 +5,7 @@ Vagrant::Spec::Acceptance.configure do |c| c.skeleton_paths << File.expand_path("../test/acceptance/skeletons", __FILE__) # Allow for slow setup to still pass c.assert_retries = 15 + c.vagrant_path = "vagrant" c.provider "virtualbox", box: ENV["VAGRANT_SPEC_BOX"], contexts: ["provider-context/virtualbox"]