|
| 1 | +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 | + BUNDLE_WITHOUT: development:test:release |
| 15 | + 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 | + - name: Setup Test Matrix |
| 25 | + id: get-outputs |
| 26 | + run: bundle exec metadata2gha --use-fqdn --pidfile-workaround CentOS,Ubuntu |
| 27 | + |
| 28 | + unit: |
| 29 | + needs: setup_matrix |
| 30 | + runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}} |
| 35 | + env: |
| 36 | + BUNDLE_WITHOUT: development:system_tests:release |
| 37 | + PUPPET_VERSION: "~> ${{ matrix.puppet }}.0" |
| 38 | + name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v2 |
| 41 | + - name: Setup ruby |
| 42 | + uses: ruby/setup-ruby@v1 |
| 43 | + with: |
| 44 | + ruby-version: ${{ matrix.ruby }} |
| 45 | + bundler-cache: true |
| 46 | + - name: Run tests |
| 47 | + run: bundle exec rake |
| 48 | + |
| 49 | + acceptance: |
| 50 | + needs: setup_matrix |
| 51 | + runs-on: ubuntu-latest |
| 52 | + env: |
| 53 | + BUNDLE_WITHOUT: development:test:release |
| 54 | + strategy: |
| 55 | + fail-fast: false |
| 56 | + matrix: |
| 57 | + setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}} |
| 58 | + puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}} |
| 59 | + name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} |
| 60 | + steps: |
| 61 | + - name: Enable IPv6 on docker |
| 62 | + run: | |
| 63 | + echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json |
| 64 | + sudo service docker restart |
| 65 | + - uses: actions/checkout@v2 |
| 66 | + - name: Setup ruby |
| 67 | + uses: ruby/setup-ruby@v1 |
| 68 | + with: |
| 69 | + ruby-version: '2.7' |
| 70 | + bundler-cache: true |
| 71 | + - name: Run tests |
| 72 | + run: bundle exec rake beaker |
| 73 | + env: |
| 74 | + BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }} |
| 75 | + BEAKER_setfile: ${{ matrix.setfile.value }} |
0 commit comments