@@ -12,10 +12,90 @@ jobs:
12
12
runs_on : " ubuntu-20.04"
13
13
secrets : " inherit"
14
14
15
+ setup_matrix :
16
+ name : " Setup Test Matrix"
17
+ needs : " Spec"
18
+ runs-on : ubuntu-20.04
19
+ outputs :
20
+ matrix : ${{ steps.get-matrix.outputs.matrix }}
21
+
22
+ steps :
23
+ - name : Checkout Source
24
+ uses : actions/checkout@v2
25
+
26
+ - name : Activate Ruby 2.7
27
+ uses : ruby/setup-ruby@v1
28
+ with :
29
+ ruby-version : " 2.7"
30
+ bundler-cache : true
31
+
32
+ - name : Print bundle environment
33
+ run : |
34
+ echo ::group::bundler environment
35
+ bundle env
36
+ echo ::endgroup::
37
+
38
+ - name : Run validation steps
39
+ run : |
40
+ bundle exec rake validate
41
+
42
+ - name : Setup Acceptance Test Matrix
43
+ id : get-matrix
44
+ run : |
45
+ bundle exec matrix_from_metadata_v2
46
+
15
47
Acceptance :
16
- needs : Spec
17
- uses : " puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
18
- with :
19
- runs_on : " ubuntu-20.04"
20
- secrets : " inherit"
48
+ name : " ${{matrix.platforms.label}}, ${{matrix.collection}}"
49
+ needs :
50
+ - setup_matrix
51
+ if : ${{ needs.setup_matrix.outputs.matrix != '{}' }}
52
+
53
+ runs-on : ubuntu-20.04
54
+ strategy :
55
+ fail-fast : false
56
+ matrix : ${{fromJson(needs.setup_matrix.outputs.matrix)}}
57
+
58
+ steps :
59
+ - name : Checkout Source
60
+ uses : actions/checkout@v2
61
+
62
+ - name : Activate Ruby 2.7
63
+ uses : ruby/setup-ruby@v1
64
+ with :
65
+ ruby-version : " 2.7"
66
+ bundler-cache : true
67
+
68
+ - name : Print bundle environment
69
+ run : |
70
+ bundle env
71
+
72
+ - name : " Disable mysqld apparmor profile"
73
+ if : matrix.platforms.provider == 'provision::docker'
74
+ run : |
75
+ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
76
+ sudo apparmor_parser -R /etc/apparmor.d/disable/usr.sbin.mysqld
77
+
78
+ - name : Provision test environment
79
+ run : |
80
+ bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
81
+ FILE='spec/fixtures/litmus_inventory.yaml'
82
+ sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
83
+
84
+ - name : Install agent
85
+ run : |
86
+ bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
87
+
88
+ - name : Install module
89
+ run : |
90
+ bundle exec rake 'litmus:install_module'
91
+
92
+ - name : Run acceptance tests
93
+ run : |
94
+ bundle exec rake 'litmus:acceptance:parallel'
95
+
96
+ - name : Remove test environment
97
+ if : ${{ always() }}
98
+ continue-on-error : true
99
+ run : |
100
+ bundle exec rake 'litmus:tear_down'
21
101
0 commit comments