Move provision yaml #16
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
--- | |
name: "Integration Testing" | |
on: | |
push: | |
branches: | |
- "*" | |
jobs: | |
setup_matrix: | |
name: "Setup Test Matrix" | |
runs-on: ubuntu-20.04 | |
outputs: | |
matrix: ${{ steps.get-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
if: ${{ github.repository_owner == 'benjamin-robertson' }} | |
- name: Activate Ruby 2.7 | |
uses: ruby/setup-ruby@v1 | |
if: ${{ github.repository_owner == 'benjamin-robertson' }} | |
with: | |
ruby-version: "2.7" | |
bundler-cache: true | |
- name: Print bundle environment | |
if: ${{ github.repository_owner == 'benjamin-robertson' }} | |
run: | | |
echo ::group::bundler environment | |
bundle env | |
echo ::endgroup:: | |
- name: Setup Integration Test Matrix | |
id: get-matrix | |
run: | | |
if [ '${{ github.repository_owner }}' == 'benjamin-robertson' ]; then | |
echo "matrix={'platform':['centos-stream8'],'collection':['puppet7-nightly', 'puppet8-nightly']}" >> $GITHUB_OUTPUT | |
else | |
echo "matrix={}" >> $GITHUB_OUTPUT | |
fi | |
Integration: | |
needs: | |
- setup_matrix | |
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} | |
env: | |
PUPPET_GEM_VERSION: '~> 7.24' | |
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set? | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
- name: Activate Ruby 2.7 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "2.7" | |
bundler-cache: true | |
- name: Print bundle environment | |
run: | | |
echo ::group::bundler environment | |
bundle env | |
echo ::endgroup:: | |
- name: Create the fixtures directory | |
run: | | |
bundle exec rake spec_prep | |
- name: check vars | |
run: | | |
export | |
- name: Provision test environment | |
run: | | |
# location=`pwd` | |
# echo $location | |
# bundle exec bolt --modulepath spec/fixtures/modules task run provision::provision_service --target localhost action=provision platform=centos-stream8 vars=observium inventory=$location THis one use last | |
# bundle exec bolt --modulepath spec/fixtures/modules plan run observium::acceptance::provision_integration image=${{ matrix.platform }} | |
# Redact password | |
# bundle exec rake 'litmus:provision[docker, litmusimage/centos:stream8]' | |
bundle exec rake 'litmus:provision_list[docker]' | |
FILE='spec/fixtures/litmus_inventory.yaml' | |
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true | |
- name: Install Agents and module | |
run: | | |
bundle exec rake 'litmus:install_agent' | |
bundle exec rake litmus:install_module | |
- name: Run integration tests | |
run: | | |
bundle exec rake litmus:acceptance:parallel | |
- name: Remove test environment | |
if: ${{ always() }} | |
continue-on-error: true | |
run: | | |
ls -lh ./spec/fixtures/ | |
cat ./spec/fixtures/litmus_inventory.yaml | |
bundle exec rake 'litmus:tear_down' |