Skip to content

Commit

Permalink
Feature uplift puppet 8 (#2)
Browse files Browse the repository at this point in the history
* Push syntax lint updates

* Use new runtime variable

* added actions testing

* Push for action run

* added test matrix

* Update reference

* Remove on push

* Update change log
  • Loading branch information
benjamin-robertson authored Oct 17, 2024
1 parent 1a54774 commit a7cf9a1
Show file tree
Hide file tree
Showing 25 changed files with 566 additions and 241 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: "Lint testing"

on:
pull_request:
branches:
- "main"

jobs:
setup_matrix:
name: "Setup Test Matrix"
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}

steps:
- name: Checkout Source
uses: actions/checkout@v3

- name: Activate Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.3"
bundler-cache: true

- name: Print bundle environment
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::
- name: Setup Integration Test Matrix
id: get-matrix
run: |
echo "matrix=$(cat test_matrix.json | tr -s '\n' ' ')" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
lint:
name: "Lint tests (${{matrix.collection.agent_version}})"
needs:
- setup_matrix
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}

runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
PUPPET_GEM_VERSION: ${{matrix.collection.gem_version}}
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?

steps:
- name: Checkout Source
uses: actions/checkout@v3

- name: Activate Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.3"
bundler-cache: true

- name: Print bundle environment
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::
- name: "Run tests"
run: |
bundle exec rake validate
71 changes: 71 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: "Unit Testing"

on:
pull_request:
branches:
- "main"

jobs:
setup_matrix:
name: "Setup Test Matrix"
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}

steps:
- name: Checkout Source
uses: actions/checkout@v3

- name: Activate Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.3"
bundler-cache: true

- name: Print bundle environment
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::
- name: Setup Integration Test Matrix
id: get-matrix
run: |
echo "matrix=$(cat test_matrix.json | tr -s '\n' ' ')" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
Unit:
name: "Unit tests (${{matrix.collection.agent_version}})"
needs:
- setup_matrix
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}

runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
PUPPET_GEM_VERSION: ${{matrix.collection.gem_version}}
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?.

steps:
- name: Checkout Source
uses: actions/checkout@v3

- name: Activate Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.3"
bundler-cache: true

- name: Print bundle environment
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::
- name: "Run tests"
run: |
bundle exec rake parallel_spec
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/spec/fixtures/modules/*
/tmp/
/vendor/
/.vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
.resource_types
.modules
.task_cache.json
.plan_cache.json
.rerun.json
bolt-debug.log
16 changes: 10 additions & 6 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,34 @@
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/spec/fixtures/modules/*
/tmp/
/vendor/
/.vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
/appveyor.yml
/.editorconfig
.resource_types
.modules
.task_cache.json
.plan_cache.json
.rerun.json
bolt-debug.log
/.fixtures.yml
/Gemfile
/.gitattributes
/.github/
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/..yml
/.yardopts
/spec/
/.vscode/
Expand Down
Loading

0 comments on commit a7cf9a1

Please sign in to comment.