-
Notifications
You must be signed in to change notification settings - Fork 236
modernize test framework and add ci workflow #385
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d8a026a
Modernize/Fix CI
smortex 069288e
update pdk template 3.0.1
h0tw1r3 2539434
disable out-of-scope puppet-lint checks
smortex 3da561a
address pdk validation warnings
h0tw1r3 5a8cabc
pin fixtures for modules where latest is not supported
h0tw1r3 f648b4a
setup rspec defaults and helpers
h0tw1r3 68c1852
100% unit test coverage
h0tw1r3 a8ab514
add github workflows for unit spec tests
h0tw1r3 94c615c
generate reference documentation
h0tw1r3 6663970
cleanup fixtures
h0tw1r3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,22 @@ | ||
name: "ci" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "main" | ||
paths-ignore: | ||
- '**.md' | ||
- 'examples/**' | ||
- 'LICENSE' | ||
- 'CODEOWNERS' | ||
- 'AUTHORS' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Spec: | ||
uses: ./.github/workflows/module_ci.yml | ||
secrets: inherit |
This file contains hidden or 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,86 @@ | ||
# This is a generic workflow for Puppet module CI operations. | ||
name: "Module CI" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runs_on: | ||
description: "The operating system used for the runner." | ||
required: false | ||
default: "ubuntu-latest" | ||
type: "string" | ||
flags: | ||
description: "Additional flags to pass to matrix_from_metadata_v2." | ||
required: false | ||
default: '' | ||
type: "string" | ||
|
||
jobs: | ||
setup_matrix: | ||
name: "Setup Test Matrix" | ||
runs-on: ${{ inputs.runs_on }} | ||
outputs: | ||
spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }} | ||
|
||
steps: | ||
|
||
- name: "Checkout" | ||
uses: "actions/checkout@v4" | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: "Setup ruby" | ||
uses: "ruby/setup-ruby@v1" | ||
with: | ||
ruby-version: "2.7" | ||
bundler-cache: true | ||
|
||
- name: "Bundle environment" | ||
run: | | ||
echo ::group::bundler environment | ||
bundle env | ||
echo ::endgroup:: | ||
|
||
- name: Setup Spec Test Matrix | ||
id: get-matrix | ||
run: | | ||
bundle exec matrix_from_metadata_v2 ${{ inputs.flags }} | ||
|
||
spec: | ||
name: "Spec tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})" | ||
needs: "setup_matrix" | ||
runs-on: ${{ inputs.runs_on }} | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson( needs.setup_matrix.outputs.spec_matrix ) }} | ||
|
||
env: | ||
PUPPET_GEM_VERSION: ${{ matrix.puppet_version }} | ||
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set? | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v4" | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: "Setup ruby" | ||
uses: "ruby/setup-ruby@v1" | ||
with: | ||
ruby-version: ${{matrix.ruby_version}} | ||
bundler-cache: true | ||
|
||
- name: "Bundle environment" | ||
run: | | ||
echo ::group::bundler environment | ||
bundle env | ||
echo ::endgroup:: | ||
|
||
- name: "Run Static & Syntax Tests" | ||
run: | | ||
bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop | ||
bundle exec dependency-checker metadata.json || true # temporarily allow to fail | ||
|
||
- name: "Run tests" | ||
run: | | ||
bundle exec rake parallel_spec |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
--relative | ||
--no-parameter_types-check | ||
--no-parameter_documentation-check | ||
--no-documentation-check | ||
h0tw1r3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--no-140chars-check |
This file contains hidden or 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 @@ | ||
--format progress |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.