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