|
| 1 | +--- |
| 2 | +name: "Install fips test matrix" |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: [main] |
| 7 | + types: [review_requested] |
| 8 | + workflow_dispatch: {} |
| 9 | + |
| 10 | +env: |
| 11 | + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 |
| 12 | + HONEYCOMB_DATASET: litmus tests |
| 13 | + |
| 14 | +jobs: |
| 15 | + test-install: |
| 16 | + name: "PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} with fips ${{ matrix.fips }}" |
| 17 | + runs-on: ubuntu-20.04 |
| 18 | + env: |
| 19 | + BOLT_GEM: true |
| 20 | + BOLT_DISABLE_ANALYTICS: true |
| 21 | + BUILDEVENT_FILE: '../buildevents.txt' |
| 22 | + LANG: 'en_US.UTF-8' |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + architecture: |
| 27 | + - standard-with-dr |
| 28 | + - large |
| 29 | + - extra-large-with-dr |
| 30 | + version: |
| 31 | + - 2019.8.11 |
| 32 | + - 2021.6.0 |
| 33 | + image: |
| 34 | + - rhel-8 |
| 35 | + fips: |
| 36 | + - enable |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: "Honeycomb: Start recording" |
| 40 | + uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 |
| 41 | + with: |
| 42 | + apikey: ${{ env.HONEYCOMB_WRITEKEY }} |
| 43 | + dataset: ${{ env.HONEYCOMB_DATASET }} |
| 44 | + job-status: ${{ job.status }} |
| 45 | + |
| 46 | + - name: "Honeycomb: Start first step" |
| 47 | + run: | |
| 48 | + echo STEP_ID=setup-test-cluster >> $GITHUB_ENV |
| 49 | + echo STEP_START=$(date +%s) >> $GITHUB_ENV |
| 50 | +
|
| 51 | + - name: "Checkout Source" |
| 52 | + uses: actions/checkout@v2 |
| 53 | + |
| 54 | + - name: "Activate Ruby 2.7" |
| 55 | + uses: ruby/setup-ruby@v1 |
| 56 | + with: |
| 57 | + ruby-version: "2.7" |
| 58 | + bundler-cache: true |
| 59 | + |
| 60 | + - name: "Print bundle environment" |
| 61 | + if: ${{ github.repository_owner == 'puppetlabs' }} |
| 62 | + run: | |
| 63 | + echo ::group::info:bundler |
| 64 | + buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env |
| 65 | + echo ::endgroup:: |
| 66 | +
|
| 67 | + - name: "Honeycomb: Record environment setup time" |
| 68 | + if: ${{ always() }} |
| 69 | + run: | |
| 70 | + echo ::group::honeycomb |
| 71 | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Set up environment' |
| 72 | + echo STEP_ID=${{ matrix.architecture }}-${{ matrix.image }}-fips_${{ matrix.fips }}-provision >> $GITHUB_ENV |
| 73 | + echo STEP_START=$(date +%s) >> $GITHUB_ENV |
| 74 | + echo ::endgroup:: |
| 75 | +
|
| 76 | + - name: 'Provision test cluster' |
| 77 | + timeout-minutes: 15 |
| 78 | + run: | |
| 79 | + echo ::group::prepare |
| 80 | + mkdir -p $HOME/.ssh |
| 81 | + echo 'Host *' > $HOME/.ssh/config |
| 82 | + echo ' ServerAliveInterval 150' >> $HOME/.ssh/config |
| 83 | + echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config |
| 84 | + buildevents cmd $TRACE_ID $STEP_ID 'rake spec_prep' -- bundle exec rake spec_prep |
| 85 | + echo ::endgroup:: |
| 86 | +
|
| 87 | + echo ::group::provision |
| 88 | + buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::provision_test_cluster' -- \ |
| 89 | + bundle exec bolt plan run peadm_spec::provision_test_cluster \ |
| 90 | + --modulepath spec/fixtures/modules \ |
| 91 | + provider=provision_service \ |
| 92 | + image=${{ matrix.image }} \ |
| 93 | + architecture=${{ matrix.architecture }} |
| 94 | + echo ::endgroup:: |
| 95 | +
|
| 96 | + echo ::group::info:request |
| 97 | + cat request.json || true; echo |
| 98 | + echo ::endgroup:: |
| 99 | +
|
| 100 | + echo ::group::info:inventory |
| 101 | + sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true |
| 102 | + echo ::endgroup:: |
| 103 | +
|
| 104 | + - name: "Honeycomb: Record provision time" |
| 105 | + if: ${{ always() }} |
| 106 | + run: | |
| 107 | + echo ::group::honeycomb |
| 108 | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Provision test cluster' |
| 109 | + echo STEP_ID=${{ matrix.architecture }}-${{ matrix.image }}-fips_${{ matrix.fips }}-install >> $GITHUB_ENV |
| 110 | + echo STEP_START=$(date +%s) >> $GITHUB_ENV |
| 111 | + echo ::endgroup:: |
| 112 | +
|
| 113 | + - name: 'Install PE on test cluster' |
| 114 | + timeout-minutes: 120 |
| 115 | + run: | |
| 116 | + buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::install_test_cluster' -- \ |
| 117 | + bundle exec bolt plan run peadm_spec::install_test_cluster \ |
| 118 | + --inventoryfile spec/fixtures/litmus_inventory.yaml \ |
| 119 | + --modulepath spec/fixtures/modules \ |
| 120 | + architecture=${{ matrix.architecture }} \ |
| 121 | + version=${{ matrix.version }} \ |
| 122 | + fips=${{ matrix.fips }} |
| 123 | +
|
| 124 | + - name: "Honeycomb: Record install time" |
| 125 | + if: ${{ always() }} |
| 126 | + run: | |
| 127 | + echo ::group::honeycomb |
| 128 | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Install PE on test cluster' |
| 129 | + echo STEP_ID=${{ matrix.architecture }}-${{ matrix.image }}-fips_${{ matrix.fips }}-tear_down >> $GITHUB_ENV |
| 130 | + echo STEP_START=$(date +%s) >> $GITHUB_ENV |
| 131 | + echo ::endgroup:: |
| 132 | +
|
| 133 | + - name: 'Tear down test cluster' |
| 134 | + if: ${{ always() }} |
| 135 | + continue-on-error: true |
| 136 | + run: | |
| 137 | + if [ -f spec/fixtures/litmus_inventory.yaml ]; then |
| 138 | + echo ::group::tear_down |
| 139 | + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' |
| 140 | + echo ::endgroup:: |
| 141 | +
|
| 142 | + echo ::group::info:request |
| 143 | + cat request.json || true; echo |
| 144 | + echo ::endgroup:: |
| 145 | + fi |
| 146 | +
|
| 147 | + - name: "Honeycomb: Record tear down time" |
| 148 | + if: ${{ always() }} |
| 149 | + run: | |
| 150 | + echo ::group::honeycomb |
| 151 | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Tear down test cluster' |
| 152 | + echo ::endgroup:: |
0 commit comments