This repository has been archived by the owner on Jun 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(FACT-2569) implemented acceptance tests run in GitHub Actions
- Loading branch information
Andrei Filipovici
committed
Apr 28, 2020
1 parent
fa6277c
commit e7af2e0
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh -x | ||
|
||
export DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=no_wornings | ||
export PATH=/opt/puppetlabs/puppet/bin/:/opt/puppetlabs/bin:$PATH | ||
cwd=$(pwd) | ||
|
||
printf '\nInstall bundler\n\n' | ||
gem install bundler | ||
|
||
printf '\nInstall facter 3 dependencies\n\n' | ||
cd $cwd/$FACTER_3_ROOT/acceptance && bundle install | ||
|
||
printf '\nInstall custom beaker\n\n' | ||
cd $cwd/$BEAKER_ROOT | ||
gem build beaker.gemspec | ||
gem install beaker-*.gem --bindir /bin | ||
bundle info beaker --path | ||
|
||
printf '\nBeaker provision\n\n' | ||
cd $cwd/$FACTER_3_ROOT/acceptance | ||
beaker init -h ubuntu1804-64a{hypervisor=none\,hostname=localhost} -o config/aio/options.rb | ||
beaker provision | ||
|
||
printf '\nBeaker pre-suite\n\n' | ||
BP_ROOT=`bundle info beaker-puppet --path` | ||
beaker exec pre-suite --pre-suite $BP_ROOT/setup/aio/010_Install_Puppet_Agent.rb | ||
|
||
printf '\nConfigure facter 4 as facter 3\n\n' | ||
puppet config set facterng true | ||
|
||
printf '\nInstall facter 4 dependencies\n\n' | ||
cd $cwd/$FACTER_4_ROOT && bundle install | ||
|
||
printf '\nInstall facter 4\n\n' | ||
gem build facter.gemspec | ||
gem install -f facter-*.gem | ||
|
||
printf '\nBeaker tests\n\n' | ||
cd $cwd/$FACTER_3_ROOT/acceptance | ||
beaker exec tests --test-tag-exclude=server,facter_3 --test-tag-or=risk:high,audit:high |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
name: GitHub hosted facter CI | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
ci: | ||
name: Run acceptance tests | ||
runs-on: ubuntu-latest | ||
env: | ||
FACTER_3_ROOT: facter_3 | ||
FACTER_4_ROOT: facter_4 | ||
BEAKER_ROOT: beaker | ||
SHA: latest | ||
|
||
steps: | ||
- name: Checkout current PR | ||
uses: actions/checkout@v2 | ||
with: | ||
path: facter_4 | ||
|
||
- name: Clone facter 3 repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: puppetlabs/facter | ||
ref: master | ||
path: facter_3 | ||
|
||
- name: Clone Mihai's beaker fork | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: mihaibuzgau/beaker | ||
ref: master | ||
path: beaker | ||
|
||
- name: Install Ruby 2.6 | ||
uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.6' | ||
|
||
- name: Run acceptance tests | ||
run: sudo -E bash -c facter_4/.github/actions/presuite.sh | ||
|