Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #1614

Closed
wants to merge 1 commit into from
Closed

test #1614

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 94 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,98 @@ jobs:
with:
runs_on: "ubuntu-20.04"
secrets: "inherit"
setup_matrix:
name: "Setup Test Matrix"
runs-on: "ubuntu-20.04"
outputs:
acceptance_matrix: ${{ steps.get-matrix.outputs.matrix }}

Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
with:
runs_on: "ubuntu-20.04"
secrets: "inherit"
env:
BUNDLE_WITHOUT: release_prep

steps:

- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Setup ruby"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: "2.7"
bundler-cache: true

- name: "Bundle environment"
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::

- name: Setup Test Matrix
id: get-matrix
run: |
bundle exec matrix_from_metadata_v2

acceptance:
name: "Acceptance tests (${{matrix.platforms.label}}, ${{matrix.collection}})"
needs: "setup_matrix"
runs-on: "ubuntu-20.04"
timeout-minutes: 180
strategy:
fail-fast: false
matrix: ${{ fromJson( needs.setup_matrix.outputs.acceptance_matrix ) }}

env:
BUNDLE_WITHOUT: release_prep
PUPPET_GEM_VERSION: '~> 7.24'
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?
SERVICE_URL: "https://facade-bug-enable-ut8-debian-6f3kfepqcq-ew.a.run.app/v1/provision"

steps:

- name: "Checkout"
uses: "actions/checkout@v4"


- name: "Setup ruby"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: "2.7"
bundler-cache: true

- name: "Bundle environment"
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::

- name: "Provision environment"
run: |
if [[ "true" == "true" ]] && [[ "${{matrix.platforms.provider}}" =~ docker* ]] ; then
DOCKER_RUN_OPTS="docker_run_opts: {'--volume': '/lib/modules/$(uname -r):/lib/modules/$(uname -r)'}"
else
DOCKER_RUN_OPTS=''
fi
bundle exec rake "litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }},$DOCKER_RUN_OPTS]"
# Redact password
FILE='spec/fixtures/litmus_inventory.yaml'
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true

- name: "Install Puppet agent"
run: |
bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'

- name: "Install module"
run: |
bundle exec rake 'litmus:install_module'

- name: "Run acceptance tests"
run: |
bundle exec rake 'litmus:acceptance:parallel'

- name: "Remove test environment"
if: ${{ always() }}
continue-on-error: true
run: |
if [[ -f spec/fixtures/litmus_inventory.yaml ]]; then
bundle exec rake 'litmus:tear_down'
fi
Loading