diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index e69de29..d261b34 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -0,0 +1,74 @@ +name: Acceptance tests + +on: pull_request + +jobs: + build_cache: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: "2.7" + - uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-2.7-gems-acceptance-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-2.7-gems-acceptance- + - name: Install dependencies + run: | + gem install bundler + bundle config path vendor/bundle + bundle config without 'development test' + bundle install --jobs 4 --retry 3 + acceptance: + needs: build_cache + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + setfile: + - centos6-64{hostname=centos6-64.example.com} + - debian9-64{hostname=debian9-64.example.com} + - debian10-64{hostname=debian10-64.example.com} + - fedora31-64{hostname=fedora31-64.example.com} + - ubuntu1804-64{hostname=ubuntu1804-64.example.com} + - ubuntu2004-64{hostname=ubuntu2004-64.example.com} + puppet: + - "6" + - "5" + exclude: + - setfile: debian10-64{hostname=debian10-64.example.com} + puppet: "5" + - setfile: ubuntu2004-64{hostname=ubuntu2004-64.example.com} + puppet: "5" + name: Puppet ${{ matrix.puppet }} - ${{ matrix.setfile }} + steps: + - name: Enable IPv6 on docker + run: | + echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json + sudo service docker restart + - uses: actions/checkout@v2 + - name: Setup ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: "2.7" + - uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-2.7-gems-acceptance-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-2.7-gems-acceptance- + - name: Install dependencies + run: | + gem install bundler + bundle config path vendor/bundle + bundle config without 'development test' + bundle install --jobs 4 --retry 3 + - name: Run tests + run: bundle exec rake beaker + env: + BEAKER_PUPPET_COLLECTION: puppet${{ matrix.puppet }} + BEAKER_setfile: ${{ matrix.setfile }} diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index e69de29..bd43a62 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -0,0 +1,114 @@ +name: Nightly tests + +on: + schedule: + - cron: '4 * * * *' + +jobs: + unit: + if: github.repository == 'theforeman/puppet-puppet' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: + - "2.5" + - "2.4" + puppet: + - "6" + - "5" + exclude: + - ruby: "2.5" + puppet: "5" + - ruby: "2.4" + puppet: "6" + env: + PUPPET_VERSION: "${{ matrix.puppet }}.0" + name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) + steps: + - uses: actions/checkout@v2 + - name: Setup ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-gems-unit-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-gems-unit- + - name: Install dependencies + run: | + gem install bundler + bundle config path vendor/bundle + bundle config without 'development system_tests' + bundle install --jobs 4 --retry 3 + - name: Run tests + run: bundle exec rake + + build_cache: + if: github.repository == 'theforeman/puppet-puppet' + runs-on: ubuntu-latest + steps: + - name: Enable IPv6 on docker + run: | + echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json + sudo service docker restart + - uses: actions/checkout@v2 + - name: Setup ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: "2.7" + - uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-2.7-gems-acceptance-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-2.7-gems-acceptance- + - name: Install dependencies + run: | + gem install bundler + bundle config path vendor/bundle + bundle config without 'development test' + bundle install --jobs 4 --retry 3 + acceptance: + if: github.repository == 'theforeman/puppet-puppet' + needs: build_cache + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + setfile: + - centos7-64{hostname=centos7-64.example.com} + - centos8-64{hostname=centos8-64.example.com} + puppet: + - "6" + - "5" + name: Puppet ${{ matrix.puppet }} - ${{ matrix.setfile }} + steps: + - name: Enable IPv6 on docker + run: | + echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json + sudo service docker restart + - uses: actions/checkout@v2 + - name: Setup ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: "2.7" + - uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-2.7-gems-acceptance-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-2.7-gems-acceptance- + - name: Install dependencies + run: | + gem install bundler + bundle config path vendor/bundle + bundle config without 'development test' + bundle install --jobs 4 --retry 3 + - name: Run tests + run: bundle exec rake beaker + env: + BEAKER_PUPPET_COLLECTION: puppet${{ matrix.puppet }} + BEAKER_setfile: ${{ matrix.setfile }} diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index e69de29..432fb74 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -0,0 +1,44 @@ +name: Unit tests + +on: pull_request + +jobs: + unit: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: + - "2.5" + - "2.4" + puppet: + - "6" + - "5" + exclude: + - ruby: "2.5" + puppet: "5" + - ruby: "2.4" + puppet: "6" + name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) + env: + PUPPET_VERSION: "${{ matrix.puppet }}.0" + steps: + - uses: actions/checkout@v2 + - name: Setup ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-gems-unit-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-gems-unit- + - name: Install dependencies + run: | + gem install bundler + bundle config path vendor/bundle + bundle config without 'development system_tests' + bundle install --jobs 4 --retry 3 + - name: Run tests + run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8c5f330..0000000 --- a/.travis.yml +++ /dev/null @@ -1,126 +0,0 @@ ---- -# This file is managed centrally by modulesync -# https://github.com/theforeman/foreman-installer-modulesync -env: - global: - - PARALLEL_TEST_PROCESSORS=8 -matrix: - fast_finish: true - include: - - rvm: 2.4.1 - env: PUPPET_VERSION=5.0 - - rvm: 2.5.1 - env: PUPPET_VERSION=6.0 - # Acceptance tests - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet5 - - BEAKER_setfile=centos6-64{hostname=centos6-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - BEAKER_setfile=centos6-64{hostname=centos6-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet5 - - BEAKER_setfile=debian9-64{hostname=debian9-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - BEAKER_setfile=debian9-64{hostname=debian9-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - BEAKER_setfile=debian10-64{hostname=debian10-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet5 - - BEAKER_setfile=fedora31-64{hostname=fedora31-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - BEAKER_setfile=fedora31-64{hostname=fedora31-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet5 - - BEAKER_setfile=ubuntu1804-64{hostname=ubuntu1804-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - BEAKER_setfile=ubuntu1804-64{hostname=ubuntu1804-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - - - rvm: 2.5.1 - env: - - BEAKER_PUPPET_COLLECTION=puppet6 - - BEAKER_setfile=ubuntu2004-64{hostname=ubuntu2004-64.example.com} - script: bundle exec rake beaker - services: docker - bundler_args: --without development - before_install: - - echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - -bundler_args: --without system_tests development -dist: xenial