-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing docker memory reduction and non-parallel jobs
- Loading branch information
Showing
6 changed files
with
156 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# This is a generic workflow for Puppet module acceptance operations. | ||
name: "Module Acceptance" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runs_on: | ||
description: "The operating system used for the runner." | ||
required: false | ||
default: "ubuntu-latest" | ||
type: "string" | ||
flags: | ||
description: "Additional flags to pass to matrix_from_metadata_v2." | ||
required: false | ||
default: '' | ||
type: "string" | ||
|
||
jobs: | ||
|
||
setup_matrix: | ||
name: "Setup Test Matrix" | ||
runs-on: ${{ inputs.runs_on }} | ||
outputs: | ||
acceptance_matrix: ${{ steps.get-matrix.outputs.matrix }} | ||
|
||
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 ${{ inputs.flags }} | ||
acceptance: | ||
name: "Acceptance tests (${{matrix.platforms.label}}, ${{matrix.collection}})" | ||
needs: "setup_matrix" | ||
runs-on: ${{ inputs.runs_on }} | ||
timeout-minutes: 30 | ||
strategy: | ||
max-parallel: 6 | ||
fail-fast: false | ||
matrix: ${{ fromJson( needs.setup_matrix.outputs.acceptance_matrix ) }} | ||
|
||
env: | ||
PUPPET_GEM_VERSION: '~> 7.24' | ||
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: "2.7" | ||
bundler-cache: true | ||
|
||
- name: "Bundle environment" | ||
run: | | ||
echo ::group::bundler environment | ||
bundle env | ||
echo ::endgroup:: | ||
- name: "Provision environment" | ||
run: | | ||
if [[ "${{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' | ||
- 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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters