Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
  • Loading branch information
wilfriedroset committed Oct 16, 2023
0 parents commit b3e6f65
Show file tree
Hide file tree
Showing 39 changed files with 2,405 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file can be used to install module dependencies for unit testing
# See https://github.com/puppetlabs/puppetlabs_spec_helper#using-fixtures for details
---
fixtures:
forge_modules:
stdlib: "puppetlabs/stdlib"
systemd: "camptocamp/systemd"
logrotate: "puppet/logrotate"
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
23 changes: 23 additions & 0 deletions .github/workflows/publish_on_forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build and publish to Puppet Forge

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get latest tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Clone repository
uses: actions/checkout@v4
with:
ref: ${{ steps.vars.outputs.tag }}
- name: Build and publish module
uses: barnumbirr/action-forge-publish@v2.7.0
env:
FORGE_API_KEY: ${{ secrets.FORGE_API_KEY }}
REPOSITORY_URL: https://forgeapi.puppet.com/v3/releases
31 changes: 31 additions & 0 deletions .github/workflows/references.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: References check

on:
- push
- pull_request

jobs:
reference_diff:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install puppet-strings
run: |
sudo apt update
sudo apt install -y ruby
sudo gem install puppet puppet-strings
- name: Generate temporary strings
run: |
puppet strings generate --format markdown --out /tmp/references.md -d
- name: Compare the actual and expected
run: |
if ! cmp "REFERENCE.md" "/tmp/references.md"; then
diff -u REFERENCE.md /tmp/references.md
echo "Diff between expected references and the commited file, please regenerate references \
with puppet strings generate --format markdown --out REFERENCE.md and commit them"
exit 1
else
echo "References are up to date"
fi
15 changes: 15 additions & 0 deletions .github/workflows/syntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Run syntax validation

on:
- push
- pull_request

jobs:
syntax:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Run static validation and save report to junit xml
uses: puppets-epic-show-theatre/action-pdk-validate@v1
15 changes: 15 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Run unit tests

on:
- push
- pull_request

jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Run unit tests and save report to junit xml
uses: puppets-epic-show-theatre/action-pdk-test-unit@v1
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/*
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
43 changes: 43 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/*
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
/..yml
/.yardopts
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-puppet-lint
rev: v2.4.2
hooks:
- id: puppet-lint
args:
- --with-filename
- --no-autoloader_layout-check
- --no-variable_scope-check
- --no-documentation-check
- --no-80chars-check
- --no-arrow_alignment-check

- repo: https://github.com/chriskuehl/puppet-pre-commit-hooks
rev: v2.0.2
hooks:
- id: puppet-validate
- id: erb-validate
2 changes: 2 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--relative
--no-140chars-check
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--format documentation
Loading

0 comments on commit b3e6f65

Please sign in to comment.