diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e26434186..569587bcc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,6 @@ jobs: matrix: os: - "ubuntu-latest" - - "windows-2019" ruby_version: - "2.7" - "3.2" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 849422c75..acd1aadbc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -34,7 +34,6 @@ jobs: matrix: os: - "ubuntu-latest" - - "windows-2019" ruby_version: - "2.7" - "3.2" diff --git a/.github/workflows/windows-acceptance.yml b/.github/workflows/windows-acceptance.yml new file mode 100644 index 000000000..1983310d9 --- /dev/null +++ b/.github/workflows/windows-acceptance.yml @@ -0,0 +1,58 @@ +# This is a generic workflow for gem Acceptance operations. +name: "Windows Acceptance" + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + workflow_dispatch: + +jobs: + acceptance: + name: "acceptance" + runs-on: 'ubuntu-latest' + timeout-minutes: 180 + strategy: + fail-fast: false + + env: + PUPPET_VERSION: puppet8-nightly + PUPPET_GEM_VERSION: puppet8-nightly + + steps: + + - name: "checkout" + uses: "actions/checkout@v4" + + - name: "setup ruby" + uses: "ruby/setup-ruby@v1" + with: + ruby-version: '3.2' + bundler-cache: true + + - name: "Bundle environment" + run: | + echo ::group::bundler environment + bundle env + echo ::endgroup:: + + - name: "Provision environment" + run: | + bundle exec rake "litmus:provision[provision_service,windows-2019]" + # Redact password + FILE='spec/fixtures/litmus_inventory.yaml' + sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true + + - name: "Run acceptance tests" + run: | + bundle exec rake 'litmus:acceptance:parallel' + + # - name: "Remove test environment" + # continue-on-error: true + # run: | + # if [[ -f spec/fixtures/litmus_inventory.yaml ]]; then + # bundle exec rake 'litmus:tear_down' + # fi diff --git a/Gemfile b/Gemfile index db64ff676..a8005a327 100644 --- a/Gemfile +++ b/Gemfile @@ -35,4 +35,5 @@ end group :acceptance_ci do gem 'puppetlabs_spec_helper', '~> 7.0', require: false + gem 'puppet_litmus', '~> 1.0', require: false end diff --git a/Rakefile b/Rakefile index ff377d384..2395d4e73 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ require 'bundler/gem_tasks' require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? +require 'puppetlabs_spec_helper/rake_tasks' require 'rspec/core/rake_task' require 'rubocop/rake_task' diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 8a80661a7..d67ddd3b7 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -6,6 +6,9 @@ require 'pdk/util/template_uri' require 'tempfile' require 'json' +require 'puppet_litmus' + +PuppetLitmus.configure! # Sets default puppet/ruby versions to be used within the tests # Duplicates of this are found within spec_helper.rb and spec_helper_package.rb and should be updated simultaneously.