|
4 | 4 |
|
5 | 5 | name: CI |
6 | 6 |
|
7 | | -on: pull_request |
| 7 | +# yamllint disable-line rule:truthy |
| 8 | +on: |
| 9 | + pull_request: {} |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + - master |
8 | 14 |
|
9 | 15 | concurrency: |
10 | 16 | group: ${{ github.ref_name }} |
11 | 17 | cancel-in-progress: true |
12 | 18 |
|
13 | 19 | jobs: |
14 | | - setup_matrix: |
15 | | - name: 'Setup Test Matrix' |
16 | | - runs-on: ubuntu-latest |
17 | | - timeout-minutes: 40 |
18 | | - outputs: |
19 | | - beaker_setfiles: ${{ steps.get-outputs.outputs.beaker_setfiles }} |
20 | | - puppet_major_versions: ${{ steps.get-outputs.outputs.puppet_major_versions }} |
21 | | - puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }} |
22 | | - env: |
23 | | - BUNDLE_WITHOUT: development:system_tests:release |
24 | | - steps: |
25 | | - - uses: actions/checkout@v2 |
26 | | - - name: Setup ruby |
27 | | - uses: ruby/setup-ruby@v1 |
28 | | - with: |
29 | | - ruby-version: '3.0' |
30 | | - bundler-cache: true |
31 | | - - name: Run static validations |
32 | | - run: bundle exec rake validate lint check |
33 | | - - name: Run rake rubocop |
34 | | - run: bundle exec rake rubocop |
35 | | - - name: Setup Test Matrix |
36 | | - id: get-outputs |
37 | | - run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false |
38 | | - |
39 | | - unit: |
40 | | - needs: setup_matrix |
41 | | - runs-on: ubuntu-latest |
42 | | - timeout-minutes: 40 |
43 | | - strategy: |
44 | | - fail-fast: false |
45 | | - matrix: |
46 | | - include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}} |
47 | | - env: |
48 | | - BUNDLE_WITHOUT: development:system_tests:release |
49 | | - PUPPET_VERSION: "~> ${{ matrix.puppet }}.0" |
50 | | - name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) |
51 | | - steps: |
52 | | - - uses: actions/checkout@v2 |
53 | | - - name: Setup ruby |
54 | | - uses: ruby/setup-ruby@v1 |
55 | | - with: |
56 | | - ruby-version: ${{ matrix.ruby }} |
57 | | - bundler-cache: true |
58 | | - - name: Run tests |
59 | | - run: bundle exec rake parallel_spec |
60 | | - |
61 | | - acceptance: |
62 | | - needs: setup_matrix |
63 | | - runs-on: ubuntu-latest |
64 | | - env: |
65 | | - BUNDLE_WITHOUT: development:test:release |
66 | | - strategy: |
67 | | - fail-fast: false |
68 | | - matrix: |
69 | | - setfile: |
70 | | - - name: CentOS 8 |
71 | | - value: centos8-64vpnserver.ma{hostname=vpnserver}-centos8-64vpnclienta.a{hostname=vpnclienta} |
72 | | - - name: Debian 11 |
73 | | - value: debian11-64vpnserver.ma{hostname=vpnserver}-debian11-64vpnclienta.a{hostname=vpnclienta} |
74 | | - - name: Ubuntu 20.04 |
75 | | - value: ubuntu2004-64vpnserver.ma{hostname=vpnserver}-ubuntu2004-64vpnclienta.a{hostname=vpnclienta} |
76 | | - - name: Ubuntu 22.04 |
77 | | - value: ubuntu2204-64vpnserver.ma{hostname=vpnserver}-ubuntu2204-64vpnclienta.a{hostname=vpnclienta} |
78 | | - puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}} |
79 | | - name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} |
80 | | - steps: |
81 | | - - uses: actions/checkout@v2 |
82 | | - - name: Setup ruby |
83 | | - uses: ruby/setup-ruby@v1 |
84 | | - with: |
85 | | - ruby-version: '3.0' |
86 | | - bundler-cache: true |
87 | | - - name: Run tests |
88 | | - run: bundle exec rake beaker |
89 | | - env: |
90 | | - BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }} |
91 | | - BEAKER_setfile: ${{ matrix.setfile.value }} |
92 | | - |
93 | | - tests: |
94 | | - needs: |
95 | | - - unit |
96 | | - - acceptance |
97 | | - runs-on: ubuntu-latest |
98 | | - name: Test suite |
99 | | - steps: |
100 | | - - run: echo Test suite completed |
| 20 | + puppet: |
| 21 | + name: Puppet |
| 22 | + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3 |
| 23 | + with: |
| 24 | + beaker_hosts: 'vpnserver:ma;vpnclienta:a' |
0 commit comments