Skip to content
Merged
Show file tree
Hide file tree
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
91 changes: 87 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,90 @@ jobs:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
secrets: "inherit"

Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@4dee504a6623266617ce7b47ae3ecbc1939788ad"
secrets: "inherit"
setup_matrix:
name: "Setup Test Matrix"
runs-on: ubuntu-latest
outputs:
acceptance_matrix: ${{ steps.get-matrix.outputs.matrix }}

env:
BUNDLE_WITHOUT: release_prep

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

- name: "Setup ruby"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: "3.1"
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_v3 --puppet-exclude 7

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

env:
BUNDLE_WITHOUT: release_prep
PUPPET_GEM_VERSION: '~> 8.9'
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?

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

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

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

- name: "Provision environment"
run: |
DOCKER_RUN_OPTS=''
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'

- 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
92 changes: 88 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,91 @@ jobs:
Spec:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
secrets: "inherit"
Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@4dee504a6623266617ce7b47ae3ecbc1939788ad"
secrets: "inherit"

setup_matrix:
name: "Setup Test Matrix"
runs-on: ubuntu-latest
outputs:
acceptance_matrix: ${{ steps.get-matrix.outputs.matrix }}

env:
BUNDLE_WITHOUT: release_prep

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

- name: "Setup ruby"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: "3.1"
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_v3 --puppet-exclude 7

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

env:
BUNDLE_WITHOUT: release_prep
PUPPET_GEM_VERSION: '~> 8.9'
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?

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

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

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

- name: "Provision environment"
run: |
DOCKER_RUN_OPTS=''
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'

- 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