@@ -12,10 +12,98 @@ jobs:
12
12
with :
13
13
runs_on : " ubuntu-20.04"
14
14
secrets : " inherit"
15
+ setup_matrix :
16
+ name : " Setup Test Matrix"
17
+ runs-on : " ubuntu-20.04"
18
+ outputs :
19
+ acceptance_matrix : ${{ steps.get-matrix.outputs.matrix }}
15
20
16
- Acceptance :
17
- needs : Spec
18
- uses : " puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
19
- with :
20
- runs_on : " ubuntu-20.04"
21
- secrets : " inherit"
21
+ env :
22
+ BUNDLE_WITHOUT : release_prep
23
+
24
+ steps :
25
+
26
+ - name : " Checkout"
27
+ uses : " actions/checkout@v4"
28
+
29
+ - name : " Setup ruby"
30
+ uses : " ruby/setup-ruby@v1"
31
+ with :
32
+ ruby-version : " 2.7"
33
+ bundler-cache : true
34
+
35
+ - name : " Bundle environment"
36
+ run : |
37
+ echo ::group::bundler environment
38
+ bundle env
39
+ echo ::endgroup::
40
+
41
+ - name : Setup Test Matrix
42
+ id : get-matrix
43
+ run : |
44
+ bundle exec matrix_from_metadata_v2
45
+
46
+ acceptance :
47
+ name : " Acceptance tests (${{matrix.platforms.label}}, ${{matrix.collection}})"
48
+ needs : " setup_matrix"
49
+ runs-on : " ubuntu-20.04"
50
+ timeout-minutes : 180
51
+ strategy :
52
+ fail-fast : false
53
+ matrix : ${{ fromJson( needs.setup_matrix.outputs.acceptance_matrix ) }}
54
+
55
+ env :
56
+ BUNDLE_WITHOUT : release_prep
57
+ PUPPET_GEM_VERSION : ' ~> 7.24'
58
+ FACTER_GEM_VERSION : ' https://github.com/puppetlabs/facter#main' # why is this set?
59
+ SERVICE_URL : " https://facade-bug-enable-ut8-debian-6f3kfepqcq-ew.a.run.app/v1/provision"
60
+
61
+ steps :
62
+
63
+ - name : " Checkout"
64
+ uses : " actions/checkout@v4"
65
+
66
+
67
+ - name : " Setup ruby"
68
+ uses : " ruby/setup-ruby@v1"
69
+ with :
70
+ ruby-version : " 2.7"
71
+ bundler-cache : true
72
+
73
+ - name : " Bundle environment"
74
+ run : |
75
+ echo ::group::bundler environment
76
+ bundle env
77
+ echo ::endgroup::
78
+
79
+ - name : " Provision environment"
80
+ run : |
81
+ if [[ "true" == "true" ]] && [[ "${{matrix.platforms.provider}}" =~ docker* ]] ; then
82
+ DOCKER_RUN_OPTS="docker_run_opts: {'--volume': '/lib/modules/$(uname -r):/lib/modules/$(uname -r)'}"
83
+ else
84
+ DOCKER_RUN_OPTS=''
85
+ fi
86
+ bundle exec rake "litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }},$DOCKER_RUN_OPTS]"
87
+ # Redact password
88
+ FILE='spec/fixtures/litmus_inventory.yaml'
89
+ sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
90
+
91
+ - name : " Install Puppet agent"
92
+ run : |
93
+ bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
94
+
95
+ - name : " Install module"
96
+ run : |
97
+ bundle exec rake 'litmus:install_module'
98
+
99
+ - name : " Run acceptance tests"
100
+ run : |
101
+ bundle exec rake 'litmus:acceptance:parallel'
102
+
103
+ - name : " Remove test environment"
104
+ if : ${{ always() }}
105
+ continue-on-error : true
106
+ run : |
107
+ if [[ -f spec/fixtures/litmus_inventory.yaml ]]; then
108
+ bundle exec rake 'litmus:tear_down'
109
+ fi
0 commit comments