Mercurial > repos > other > Puppet
annotate modules/apache/.github/workflows/spec.yml @ 442:2879e2d4148e
Configure test machine
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 03 Apr 2023 19:41:02 +0100 |
parents | b8d6ada284dd |
children |
rev | line source |
---|---|
437
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 name: "Spec Tests" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 on: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 schedule: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 - cron: '0 0 * * *' |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 workflow_dispatch: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 pull_request: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 env: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 HONEYCOMB_DATASET: litmus tests |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 jobs: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 setup_matrix: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 name: "Setup Test Matrix" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 runs-on: ubuntu-20.04 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 outputs: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 steps: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 - name: "Honeycomb: Start recording" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 with: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 apikey: ${{ env.HONEYCOMB_WRITEKEY }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 dataset: ${{ env.HONEYCOMB_DATASET }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 job-status: ${{ job.status }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 - name: "Honeycomb: Start first step" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
31 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 echo STEP_ID=setup-environment >> $GITHUB_ENV |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 echo STEP_START=$(date +%s) >> $GITHUB_ENV |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 - name: Checkout Source |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 uses: actions/checkout@v2 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 if: ${{ github.repository_owner == 'puppetlabs' }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
37 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
38 - name: Activate Ruby 2.7 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
39 uses: ruby/setup-ruby@v1 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
40 if: ${{ github.repository_owner == 'puppetlabs' }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
41 with: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
42 ruby-version: "2.7" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
43 bundler-cache: true |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
44 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
45 - name: Print bundle environment |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
46 if: ${{ github.repository_owner == 'puppetlabs' }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
47 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
48 echo ::group::bundler environment |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
49 buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
50 echo ::endgroup:: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
51 - name: "Honeycomb: Record Setup Environment time" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
52 if: ${{ github.repository_owner == 'puppetlabs' }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
53 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
54 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
55 echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
56 echo STEP_START=$(date +%s) >> $GITHUB_ENV |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
57 - name: Run Static & Syntax Tests |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
58 if: ${{ github.repository_owner == 'puppetlabs' }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
59 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
60 buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
61 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
62 - name: Setup Spec Test Matrix |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
63 id: get-matrix |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
64 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
65 if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
66 buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
67 else |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
68 echo "::set-output name=spec_matrix::{}" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
69 fi |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
70 - name: "Honeycomb: Record Setup Test Matrix time" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
71 if: ${{ always() }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
72 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
73 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
74 Spec: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
75 name: "Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
76 needs: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
77 - setup_matrix |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
78 if: ${{ needs.setup_matrix.outputs.spec_matrix != '{}' }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
79 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
80 runs-on: ubuntu-20.04 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
81 strategy: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
82 fail-fast: false |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
83 matrix: ${{fromJson(needs.setup_matrix.outputs.spec_matrix)}} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
84 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
85 env: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
86 BUILDEVENT_FILE: '../buildevents.txt' |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
87 PUPPET_GEM_VERSION: ${{ matrix.puppet_version }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
88 FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
89 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
90 steps: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
91 - run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
92 echo "SANITIZED_PUPPET_VERSION=$(echo '${{ matrix.puppet_version }}' | sed 's/~> //g')" >> $GITHUB_ENV |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
93 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
94 - run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
95 echo 'puppet_version=${{ env.SANITIZED_PUPPET_VERSION }}' >> $BUILDEVENT_FILE |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
96 - name: "Honeycomb: Start first step" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
97 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
98 echo "STEP_ID=${{ env.SANITIZED_PUPPET_VERSION }}-spec" >> $GITHUB_ENV |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
99 echo STEP_START=$(date +%s) >> $GITHUB_ENV |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
100 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
101 - name: "Honeycomb: Start recording" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
102 uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
103 with: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
104 apikey: ${{ env.HONEYCOMB_WRITEKEY }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
105 dataset: ${{ env.HONEYCOMB_DATASET }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
106 job-status: ${{ job.status }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
107 matrix-key: ${{ env.SANITIZED_PUPPET_VERSION }} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
108 - name: Checkout Source |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
109 uses: actions/checkout@v2 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
110 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
111 - name: "Activate Ruby ${{ matrix.ruby_version }}" |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
112 uses: ruby/setup-ruby@v1 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
113 with: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
114 ruby-version: ${{matrix.ruby_version}} |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
115 bundler-cache: true |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
116 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
117 - name: Print bundle environment |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
118 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
119 echo ::group::bundler environment |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
120 buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
121 echo ::endgroup:: |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
122 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
123 |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
124 - name: Run parallel_spec tests |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
125 run: | |
b8d6ada284dd
Update Apache module to latest version
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
126 buildevents cmd $TRACE_ID $STEP_ID 'rake parallel_spec Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake parallel_spec |