feat: add ci build task (#342)
- a ci workflow for build tests - run pre-commit against all files Reviewed-on: #342
This commit is contained in:
parent
be02d3d150
commit
40c57ede59
24
.gitea/workflows/build.yaml
Normal file
24
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
precommit:
|
||||||
|
runs-on: almalinux-8
|
||||||
|
container:
|
||||||
|
image: git.unkin.net/unkin/almalinux9-actionsdind:latest
|
||||||
|
options: --privileged
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install requirements
|
||||||
|
run: |
|
||||||
|
dnf groupinstall -y "Development Tools" -y
|
||||||
|
dnf install rubygems ruby-devel gcc make redhat-rpm-config glibc-headers glibc-devel -y
|
||||||
|
|
||||||
|
- name: Pre-Commit All Files
|
||||||
|
run: |
|
||||||
|
uvx pre-commit run --all-files
|
||||||
@ -8,3 +8,6 @@ Style/Documentation:
|
|||||||
|
|
||||||
Layout/LineLength:
|
Layout/LineLength:
|
||||||
Max: 140
|
Max: 140
|
||||||
|
|
||||||
|
Metrics/BlockNesting:
|
||||||
|
Max: 4
|
||||||
|
|||||||
@ -8,7 +8,6 @@ Facter.add('pve_nodelist') do
|
|||||||
conf_file = '/etc/pve/corosync.conf'
|
conf_file = '/etc/pve/corosync.conf'
|
||||||
node_list = {}
|
node_list = {}
|
||||||
current_node = nil
|
current_node = nil
|
||||||
# rubocop:disable Metrics/BlockNesting
|
|
||||||
|
|
||||||
if File.exist?(conf_file)
|
if File.exist?(conf_file)
|
||||||
File.foreach(conf_file) do |line|
|
File.foreach(conf_file) do |line|
|
||||||
@ -28,8 +27,6 @@ Facter.add('pve_nodelist') do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:enable Metrics/BlockNesting
|
|
||||||
|
|
||||||
node_list.empty? ? nil : node_list
|
node_list.empty? ? nil : node_list
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -90,7 +90,7 @@ class profiles::consul::client (
|
|||||||
# cleanup /usr/local/bin/consul which was created by url install method
|
# cleanup /usr/local/bin/consul which was created by url install method
|
||||||
if $facts['os']['family'] == 'RedHat' {
|
if $facts['os']['family'] == 'RedHat' {
|
||||||
file {'/usr/local/bin/consul':
|
file {'/usr/local/bin/consul':
|
||||||
ensure => absent,
|
ensure => absent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class profiles::ntp::client (
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
class { 'chrony':
|
class { 'chrony':
|
||||||
servers => sort($ntpserver_array),
|
servers => sort($ntpserver_array),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
# Class: profiles::puppet::enc
|
# Class: profiles::puppet::enc
|
||||||
#
|
#
|
||||||
# This class manages a Git repository at /opt/puppetlabs/enc. It includes a
|
# This class manages a Git repository at /opt/puppetlabs/enc. It includes a
|
||||||
# systemd service and timer to keep the repository updated every minute.
|
# systemd service and timer to keep the repository updated every minute.
|
||||||
# The Git package is installed if not present, and the repository at the given
|
# The Git package is installed if not present, and the repository at the given
|
||||||
# location will always reflect the state of the remote Git repository.
|
# location will always reflect the state of the remote Git repository.
|
||||||
class profiles::puppet::enc (
|
class profiles::puppet::enc (
|
||||||
String $repo,
|
String $repo,
|
||||||
@ -11,11 +11,11 @@ class profiles::puppet::enc (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
file { '/opt/puppetlabs/bin/enc':
|
file { '/opt/puppetlabs/bin/enc':
|
||||||
ensure => absent,
|
ensure => absent,
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/opt/puppetlabs/bin/puppet-enc':
|
file { '/opt/puppetlabs/bin/puppet-enc':
|
||||||
ensure => absent,
|
ensure => absent,
|
||||||
}
|
}
|
||||||
|
|
||||||
$_timer = @(EOT)
|
$_timer = @(EOT)
|
||||||
|
|||||||
@ -155,7 +155,7 @@ class profiles::puppet::puppetboard (
|
|||||||
|
|
||||||
# call the nginx selinux class
|
# call the nginx selinux class
|
||||||
class { 'profiles::selinux::nginx':
|
class { 'profiles::selinux::nginx':
|
||||||
require => Class['Nginx'],
|
require => Class['Nginx'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user