root / .github / workflows / ci.yml @ da8956d3
Historique | Voir | Annoter | Télécharger (2,43 ko)
1 | 78f22811 | Steve Traylen | name: CI |
---|---|---|---|
2 | |||
3 | on: pull_request |
||
4 | |||
5 | jobs:
|
||
6 | setup_matrix:
|
||
7 | name: 'Setup Test Matrix' |
||
8 | runs-on: ubuntu-latest |
||
9 | outputs:
|
||
10 | beaker_setfiles: ${{ steps.get-outputs.outputs.beaker_setfiles }} |
||
11 | puppet_major_versions: ${{ steps.get-outputs.outputs.puppet_major_versions }} |
||
12 | puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }} |
||
13 | env:
|
||
14 | da8956d3 | Steve Traylen | BUNDLE_WITHOUT: development:release |
15 | 78f22811 | Steve Traylen | steps:
|
16 | - uses: actions/checkout@v2
|
||
17 | - name: Setup ruby
|
||
18 | uses: ruby/setup-ruby@v1 |
||
19 | with:
|
||
20 | ruby-version: '2.7' |
||
21 | bundler-cache: true |
||
22 | - name: Run rake validate
|
||
23 | run: bundle exec rake validate |
||
24 | da8956d3 | Steve Traylen | - name: Run rake rubocop https://github.com/voxpupuli/modulesync_config/pull/690
|
25 | run: bundle exec rake rubocop |
||
26 | 78f22811 | Steve Traylen | - name: Setup Test Matrix
|
27 | id: get-outputs |
||
28 | run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false |
||
29 | |||
30 | unit:
|
||
31 | needs: setup_matrix |
||
32 | runs-on: ubuntu-latest |
||
33 | strategy:
|
||
34 | fail-fast: false |
||
35 | matrix:
|
||
36 | include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}} |
||
37 | env:
|
||
38 | BUNDLE_WITHOUT: development:system_tests:release |
||
39 | PUPPET_VERSION: "~> ${{ matrix.puppet }}.0" |
||
40 | name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) |
||
41 | steps:
|
||
42 | - uses: actions/checkout@v2
|
||
43 | - name: Setup ruby
|
||
44 | uses: ruby/setup-ruby@v1 |
||
45 | with:
|
||
46 | ruby-version: ${{ matrix.ruby }} |
||
47 | bundler-cache: true |
||
48 | - name: Run tests
|
||
49 | run: bundle exec rake |
||
50 | bd5145ab | Steve Traylen | |
51 | acceptance:
|
||
52 | needs: setup_matrix |
||
53 | runs-on: ubuntu-latest |
||
54 | env:
|
||
55 | BUNDLE_WITHOUT: development:test:release |
||
56 | strategy:
|
||
57 | fail-fast: false |
||
58 | matrix:
|
||
59 | setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}} |
||
60 | puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}} |
||
61 | name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} |
||
62 | steps:
|
||
63 | - name: Enable IPv6 on docker
|
||
64 | run: | |
||
65 | echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
|
||
66 | sudo service docker restart
|
||
67 | - uses: actions/checkout@v2
|
||
68 | - name: Setup ruby
|
||
69 | uses: ruby/setup-ruby@v1 |
||
70 | with:
|
||
71 | ruby-version: '2.7' |
||
72 | bundler-cache: true |
||
73 | - name: Run tests
|
||
74 | run: bundle exec rake beaker |
||
75 | env:
|
||
76 | BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }} |
||
77 | BEAKER_setfile: ${{ matrix.setfile.value }} |