|
| 1 | +--- |
1 | 2 | name: CI |
2 | 3 |
|
3 | 4 | on: |
4 | 5 | pull_request: |
5 | 6 | schedule: |
6 | 7 | - cron: '4 4 * * *' |
7 | 8 |
|
8 | | -jobs: |
9 | | - setup_matrix: |
10 | | - if: github.event_name != 'schedule' || github.repository_owner == 'theforeman' |
11 | | - name: 'Setup Test Matrix' |
12 | | - runs-on: ubuntu-latest |
13 | | - outputs: |
14 | | - beaker_setfiles: ${{ steps.get_outputs.outputs.beaker_setfiles }} |
15 | | - puppet_major_versions: ${{ steps.get_outputs.outputs.puppet_major_versions }} |
16 | | - puppet_unit_test_matrix: ${{ steps.get_outputs.outputs.puppet_unit_test_matrix }} |
17 | | - env: |
18 | | - BUNDLE_WITHOUT: development:system_tests:release |
19 | | - steps: |
20 | | - - uses: actions/checkout@v2 |
21 | | - - name: Setup ruby |
22 | | - uses: ruby/setup-ruby@v1 |
23 | | - with: |
24 | | - ruby-version: '2.7' |
25 | | - bundler-cache: true |
26 | | - - name: Run rake check |
27 | | - run: bundle exec rake check |
28 | | - - name: Run rake validate |
29 | | - run: bundle exec rake validate |
30 | | - - name: Run rake lint |
31 | | - run: bundle exec rake lint |
32 | | - - name: Setup Test Matrix |
33 | | - id: get_outputs |
34 | | - run: bundle exec metadata2gha --use-fqdn --pidfile-workaround true |
35 | 9 |
|
36 | | - unit: |
37 | | - needs: setup_matrix |
38 | | - runs-on: ubuntu-latest |
39 | | - strategy: |
40 | | - fail-fast: false |
41 | | - matrix: |
42 | | - include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}} |
43 | | - env: |
44 | | - BUNDLE_WITHOUT: development:system_tests:release |
45 | | - PUPPET_VERSION: "${{ matrix.puppet }}.0" |
46 | | - name: Unit / Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) |
47 | | - steps: |
48 | | - - uses: actions/checkout@v2 |
49 | | - - name: Setup ruby |
50 | | - uses: ruby/setup-ruby@v1 |
51 | | - with: |
52 | | - ruby-version: ${{ matrix.ruby }} |
53 | | - bundler-cache: true |
54 | | - - name: Run tests |
55 | | - run: bundle exec rake parallel_spec |
| 10 | +concurrency: |
| 11 | + group: ${{ github.ref_name }} |
| 12 | + cancel-in-progress: true |
56 | 13 |
|
57 | | - acceptance: |
58 | | - needs: setup_matrix |
59 | | - runs-on: ubuntu-latest |
60 | | - env: |
61 | | - BUNDLE_WITHOUT: development:test:release |
62 | | - strategy: |
63 | | - fail-fast: false |
64 | | - matrix: |
65 | | - setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}} |
66 | | - puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}} |
67 | | - name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} |
68 | | - steps: |
69 | | - - uses: actions/checkout@v2 |
70 | | - - name: Setup ruby |
71 | | - uses: ruby/setup-ruby@v1 |
72 | | - with: |
73 | | - ruby-version: '2.7' |
74 | | - bundler-cache: true |
75 | | - - name: Run tests |
76 | | - run: bundle exec rake beaker |
77 | | - env: |
78 | | - BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }} |
79 | | - BEAKER_setfile: ${{ matrix.setfile.value }} |
| 14 | +jobs: |
| 15 | + puppet: |
| 16 | + name: Puppet |
| 17 | + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1 |
| 18 | + with: |
| 19 | + pidfile_workaround: 'true' |
| 20 | + rubocop: false |
| 21 | + cache-version: '1' |
0 commit comments