Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hardcoded version of ruby and puppet and replaced with values #104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/module_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
runs-on: ${{ inputs.runs_on }}
outputs:
acceptance_matrix: ${{ steps.get-matrix.outputs.matrix }}
ruby_version: ${{ steps.get-puppet_ruby_version.outputs.ruby_version }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not have much understanding about github actions so would like to know how we are going to get the ruby and puppet version?
is it via env variables or some other way?

Also I see ruby version is still hardcoded here https://github.com/puppetlabs/cat-github-actions/pull/104/files#diff-5fce77d76af8d0d3fa602998f1421a39b77dbe8d832a45718f521b729e1fb43fR47

puppet_version: ${{ steps.get-puppet_ruby_version.outputs.puppet_version }}

env:
BUNDLE_WITHOUT: release_prep
Expand All @@ -56,8 +58,13 @@ jobs:
run: |
bundle exec matrix_from_metadata_v2 ${{ inputs.flags }}

- name: Setup Ruby Version and Setup Puppet Version
id: get-puppet_ruby_version
run: |
echo ${{ toJSON(steps.get-matrix.outputs.spec_matrix ) }} | jq -r '.include | .[0] | to_entries[] | "\(.key)=\(.value)"' >> $GITHUB_OUTPUT

acceptance:
name: "Acceptance tests (${{matrix.platforms.label}}, ${{matrix.collection}})"
name: "Acceptance tests (${{matrix.platforms.label}}, ${{matrix.collection}}) - ruby: ${{needs.setup_matrix.outputs.ruby_version}} puppet: ${{needs.setup_matrix.outputs.puppet_version}} "
needs: "setup_matrix"
runs-on: ${{ inputs.runs_on }}
timeout-minutes: 180
Expand All @@ -67,7 +74,7 @@ jobs:

env:
BUNDLE_WITHOUT: release_prep
PUPPET_GEM_VERSION: '~> 7.24'
PUPPET_GEM_VERSION: ${{needs.setup_matrix.outputs.puppet_version}}
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?

steps:
Expand All @@ -88,7 +95,7 @@ jobs:
- name: "Setup ruby"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: "2.7"
ruby-version: ${{needs.setup_matrix.outputs.ruby_version}}
bundler-cache: true

- name: "Bundle environment"
Expand Down