Skip to content

Commit e2de3ae

Browse files
timidriragingra
andauthored
Pin node_manager in metadata (#426)
* Pin WhatsARanjit/node_manager to 0.7.5 in metadata * Pulling in module_ci workflow to override dependency check --------- Co-authored-by: Dimitri Tischenko <[email protected]> Co-authored-by: Neil Anderson <[email protected]>
1 parent 9969383 commit e2de3ae

File tree

4 files changed

+99
-3
lines changed

4 files changed

+99
-3
lines changed

.github/workflows/ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99
jobs:
1010
Spec:
1111
if: ${{ github.repository_owner == 'puppetlabs' }}
12-
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
12+
# Temporary workaround for allowing locking node_manager less than latest
13+
# uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
14+
uses: "./.github/workflows/module_ci.yml"
1315
secrets: "inherit"
1416

1517
Acceptance:

.github/workflows/module_ci.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# This is a generic workflow for Puppet module CI operations.
2+
name: "Module CI"
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
runs_on:
8+
description: "The operating system used for the runner."
9+
required: false
10+
default: "ubuntu-latest"
11+
type: "string"
12+
flags:
13+
description: "Additional flags to pass to matrix_from_metadata_v2."
14+
required: false
15+
default: ''
16+
type: "string"
17+
18+
19+
jobs:
20+
setup_matrix:
21+
name: "Setup Test Matrix"
22+
runs-on: ${{ inputs.runs_on }}
23+
outputs:
24+
spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }}
25+
26+
env:
27+
BUNDLE_WITHOUT: release_prep
28+
29+
steps:
30+
31+
- name: "Checkout"
32+
uses: "actions/checkout@v4"
33+
with:
34+
ref: ${{ github.event.pull_request.head.sha }}
35+
36+
- name: "Setup ruby"
37+
uses: "ruby/setup-ruby@v1"
38+
with:
39+
ruby-version: "2.7"
40+
bundler-cache: true
41+
42+
- name: "Bundle environment"
43+
run: |
44+
echo ::group::bundler environment
45+
bundle env
46+
echo ::endgroup::
47+
48+
- name: Setup Spec Test Matrix
49+
id: get-matrix
50+
run: |
51+
bundle exec matrix_from_metadata_v2 ${{ inputs.flags }}
52+
53+
spec:
54+
name: "Spec tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})"
55+
needs: "setup_matrix"
56+
runs-on: ${{ inputs.runs_on }}
57+
strategy:
58+
fail-fast: false
59+
matrix: ${{ fromJson( needs.setup_matrix.outputs.spec_matrix ) }}
60+
61+
env:
62+
BUNDLE_WITHOUT: release_prep
63+
PUPPET_GEM_VERSION: ${{ matrix.puppet_version }}
64+
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?
65+
66+
steps:
67+
- name: "Checkout"
68+
uses: "actions/checkout@v4"
69+
with:
70+
ref: ${{ github.event.pull_request.head.sha }}
71+
72+
- name: "Setup ruby"
73+
uses: "ruby/setup-ruby@v1"
74+
with:
75+
ruby-version: ${{matrix.ruby_version}}
76+
bundler-cache: true
77+
78+
- name: "Bundle environment"
79+
run: |
80+
echo ::group::bundler environment
81+
bundle env
82+
echo ::endgroup::
83+
84+
- name: "Run Static & Syntax Tests"
85+
run: |
86+
bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
87+
bundle exec dependency-checker metadata.json --override WhatsARanjit/node_manager,0.7.5
88+
89+
90+
- name: "Run tests"
91+
run: |
92+
bundle exec rake parallel_spec

.github/workflows/nightly.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ on:
88
jobs:
99
Spec:
1010
if: ${{ github.repository_owner == 'puppetlabs' }}
11-
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
11+
# Temporary workaround for allowing locking node_manager less than latest
12+
# uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
13+
uses: "./.github/workflows/module_ci.yml"
1214
secrets: "inherit"
1315

1416
Acceptance:

metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
{
1616
"name": "WhatsARanjit/node_manager",
17-
"version_requirement": ">= 0.7.5 < 2.0.0"
17+
"version_requirement": "0.7.5"
1818
},
1919
{
2020
"name": "puppetlabs/bolt_shim",

0 commit comments

Comments
 (0)