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

[puppetsync] Clean up for linters #894

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ------------------------------------------------------------------------------
# NOTICE: **This file is maintained with puppetsync**
#
# This file is automatically updated as part of a puppet module baseline.
# The next baseline sync will overwrite any local changes made to this file.
# ------------------------------------------------------------------------------
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
*.rb eol=lf
40 changes: 40 additions & 0 deletions .github/workflows/add_new_issue_to_triage_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Add new issues to triage project board (https://github.com/orgs/simp/projects/11)
# ------------------------------------------------------------------------------
#
# NOTICE: **This file is maintained with puppetsync**
#
# This file is updated automatically as part of a puppet module baseline.
#
# The next baseline sync will overwrite any local changes to this file!
#
# ==============================================================================
# This pipeline uses the following GitHub Action Secrets:
#
# GitHub Secret variable Notes
# ------------------------------- ---------------------------------------
# AUTO_TRIAGE_TOKEN Token with appropriate permissions
#
# ------------------------------------------------------------------------------
#
#
---
name: Add new issues to triage project

'on':
issues:
types:
- opened
- reopened
pull_request_target:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/simp/projects/11
github-token: ${{ secrets.AUTO_TRIAGE_TOKEN }}
142 changes: 142 additions & 0 deletions .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Run Puppet checks and test matrix on Pull Requests
# ------------------------------------------------------------------------------
# NOTICE: **This file is maintained with puppetsync**
#
# This file is updated automatically as part of a puppet module baseline.
#
# The next baseline sync will overwrite any local changes to this file!
#
# ==============================================================================
#
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# PE 2021.Y 7.x 2.7 2025-02 (LTS)
# PE 2023.Y 8.x 3.2 Biannual updates
#
# https://puppet.com/docs/pe/latest/component_versions_in_recent_pe_releases.html
# https://puppet.com/misc/puppet-enterprise-lifecycle
# ==============================================================================
#
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
#
---
name: PR Tests
'on':
pull_request:
types: [opened, reopened, synchronize]

env:
PUPPET_VERSION: '~> 8'

jobs:
puppet-syntax:
name: 'Puppet Syntax'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Install Ruby ${{matrix.puppet.ruby_version}}"
uses: ruby/setup-ruby@v1 # ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
with:
ruby-version: 3.2
bundler-cache: true
- run: "bundle exec rake syntax"

puppet-style:
name: 'Puppet Style'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Install Ruby ${{matrix.puppet.ruby_version}}"
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- run: "bundle exec rake lint"
- run: "bundle exec rake metadata_lint"

ruby-style:
if: false # TODO Modules will need: rubocop in Gemfile, .rubocop.yml
name: 'Ruby Style (experimental)'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: "Install Ruby ${{matrix.puppet.ruby_version}}"
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- run: |
bundle show
bundle exec rake rubocop

file-checks:
name: 'File checks'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Install Ruby 3.2'
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- run: bundle exec rake check:dot_underscore
- run: bundle exec rake check:test_file

releng-checks:
name: 'RELENG checks'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Install Ruby ${{matrix.puppet.ruby_version}}'
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: 'Tags and changelogs'
run: |
bundle exec rake pkg:check_version
bundle exec rake pkg:compare_latest_tag[,true]
bundle exec rake pkg:create_tag_changelog
- name: 'Test-build the Puppet module'
run: 'bundle exec pdk build --force'

spec-tests:
name: 'Puppet Spec'
needs: [puppet-syntax]
runs-on: ubuntu-latest
strategy:
matrix:
puppet:
- label: 'Puppet 7.x [SIMP 6.6/PE 2021.7]'
puppet_version: '~> 7.0'
ruby_version: '2.7'
experimental: false
- label: 'Puppet 8.x'
puppet_version: '~> 8.0'
ruby_version: '3.2'
experimental: false
fail-fast: false
env:
PUPPET_VERSION: ${{matrix.puppet.puppet_version}}
steps:
- uses: actions/checkout@v3
- name: 'Install Ruby ${{matrix.puppet.ruby_version}}'
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.puppet.ruby_version}}
bundler-cache: true
- run: 'command -v rpm || if command -v apt-get; then sudo apt-get update; sudo apt-get install -y rpm; fi ||:'
- run: 'bundle exec rake spec'
continue-on-error: ${{matrix.puppet.experimental}}

# dump_contexts:
# name: 'Examine Context contents'
# runs-on: ubuntu-latest
# steps:
# - name: Dump contexts
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
#
Loading
Loading