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

added build workflow and el9 support #5

Closed
wants to merge 11 commits into from
Closed
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
12 changes: 12 additions & 0 deletions .github/linters/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"MD013": {
"line_length": 120,
"code_blocks": false,
"tables": false
},
"MD014": false,
"MD024": false,
"MD026": {
"punctuation": ".,:;!"
}
}
85 changes: 85 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: Create packages and test installation

on:
pull_request:

jobs:
centos7:
name: Build CentOS 7 RPMs
runs-on: ubuntu-latest
container: quay.io/centos/centos:7
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install build requisites
run: |
yum install -y cmake rpm-build rpmlint make rsync
- name: build rpm
run: |
mkdir build
cd build
make rpm -f ../Makefile
#rpmlint --file .rpmlint.ini out/noarch/*.rpm
ls -lR
- name: Upload rpms
uses: actions/upload-artifact@v3
with:
name: rpms7
path: |
out/noarch/nagios-*.el7.noarch.rpm

build-almalinux9:
name: Build AlmaLinux 9 RPMs
runs-on: ubuntu-latest
container: almalinux:9
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build requisites
run: |
dnf install -y rpm-build cmake rpmlint make rsync systemd-rpm-macros
- name: build rpm
run: |
mkdir build
cd build
make rpm -f ../Makefile
rpmlint --file .rpmlint.ini build/RPMS/noarch/*.rpm
- name: Upload RPMs
uses: actions/upload-artifact@v3
with:
name: rpms9
path: |
build/out/noarch/noarch/nagios-*.el9.x86_64.rpm

centos7-install:
name: Install CentOS 7 RPMs
needs: centos7
runs-on: ubuntu-latest
container: quay.io/centos/centos:7
steps:
- uses: actions/download-artifact@v3
with:
name: rpms7
- name: Install generated RPMs
run: |
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y http://repository.egi.eu/sw/production/umd/4/centos7/x86_64/updates/umd-release-4.1.3-1.el7.centos.noarch.rpm
yum localinstall -y ui-*.rpm

install-almalinux9:
name: Install AlmaLinux 9 RPMs
needs: build-almalinux9
runs-on: ubuntu-latest
container: almalinux:9
steps:
- uses: actions/download-artifact@v3
with:
name: rpms9
- name: Install generated RPMs
run: |
# FIXME: remove external repo when UMD5 is available
dnf install -y epel-release
dnf localinstall -y nagios-*.rpm
28 changes: 28 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Check links

on: [push, pull_request]

jobs:
markdown-link-check:
name: Check links using markdown-link-check
runs-on: ubuntu-latest

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on PR
ref: ${{ github.event.pull_request.head.sha }}
# Full git history needed to get proper list of changed files
fetch-depth: 0

- name: Check links on new changes
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: ".github/linters/mlc_config.json"
check-modified-files-only: "yes"
use-quiet-mode: "yes"
use-verbose-mode: "yes"
base-branch: "master"
14 changes: 5 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
name: Lint

on:
pull_request:
on: [pull_request]

jobs:
super-lint:
Expand All @@ -20,17 +19,14 @@ jobs:
fetch-depth: 0

# Runs the Super-Linter action
- name: Run Super-Linter
- name: Run Super-Linter on new changes
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MARKDOWN_CONFIG_FILE: .markdownlint.json
# XXX gitleaks is currently not using exception file: #511
VALIDATE_GITLEAKS: false
# Only check changed files
VALIDATE_ALL_CODEBASE: false
# Debug super-linter
ACTIONS_RUNNER_DEBUG: false
# Always check all the content
VALIDATE_ALL_CODEBASE: true
# Fail on errors
DISABLE_ERRORS: false
FILTER_REGEX_EXCLUDE: "(layouts/)|(.*/egi.js)|(assets/scss/)|(static/css/)"
110 changes: 110 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
# When a tag is created
# - create a new release from the tag
# - build and attach packages to the release
name: Create packages and release

on:
push:
tags:
- "v*"

jobs:
centos7:
name: Build centOS 7 RPMs
runs-on: ubuntu-latest
container: centos:7
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install build requisites
run: |
yum install -y rpm-build rpmlint make rsync
- name: build rpm
run: |
make rpm
rpmlint --file .rpmlint.ini build/RPMS/x86_64/*.rpm
- name: Upload rpms
uses: actions/upload-artifact@v3
with:
name: rpms7
path: |
build/RPMS/x86_64/ui-*.el7.x86_64.rpm
build/SRPMS/ui-*.el7.src.rpm

almalinux9:
name: Build AlmaLinux 9 RPMs
runs-on: ubuntu-latest
container: almalinux:9
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build requisites
run: |
dnf install -y rpm-build make rsync systemd-rpm-macros
- name: build rpm
run: |
make clean rpm
- name: Upload RPMs
uses: actions/upload-artifact@v4
with:
name: rpms9
path: |
build/RPMS/x86_64/ui-*.el9.x86_64.rpm
build/SRPMS/ui-*.el9.src.rpm

release7:
name: Upload CentOS 7 release artefacts
needs: centos7
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: rpms7

- name: Find package name
id: package_name_centos7
run: |
rpm_path=$(find . -name 'ui-*.el7.x86_64.rpm')
src_path=$(find . -name 'ui-*.el7.src.rpm')
echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT"
echo "src_path=${src_path}" >> "$GITHUB_OUTPUT"

- name: Attach CentOS 7 RPMs to the release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
files: |
${{ steps.package_name_centos7.outputs.rpm_path }}
${{ steps.package_name_centos7.outputs.src_path }}

release9:
name: Upload AlmaLinux 9 release artefacts
permissions:
contents: write # to upload release asset (softprops/action-gh-release)
needs: almalinux9
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: rpms9
- name: Find package name
id: package_name_almalinux9
run: |
rpm_path=$(find . -name 'ui-*.el9.x86_64.rpm')
src_path=$(find . -name 'ui-*.el9.src.rpm')
echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT"
echo "src_path=${src_path}" >> "$GITHUB_OUTPUT"
- name: Attach AlmaLinux 9 RPMs to the release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
files: |
${{ steps.package_name_almalinux9.outputs.rpm_path }}
${{ steps.package_name_almalinux9.outputs.src_path }}
5 changes: 4 additions & 1 deletion nagios-plugins-srm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%define nagios_plugins_dir %{_libdir}/nagios/plugins

Name: nagios-plugins-srm
Version: 0.0.7
Version: 0.1.0
Release: 1%{?dist}
Summary: Nagios probes to be run remotely against SRM mendpoints
License: ASL 2.0
Expand Down Expand Up @@ -55,6 +55,9 @@ rm -rf %{buildroot}
%doc LICENSE README.md

%changelog
* Tue Jun 11 2024 Andrea Manzi <[email protected]> - 0.1.0-0
- support for el9

* Mon Jun 19 2023 Andrea Manzi <[email protected]> - 0.0.7-0
- updated default top BDII adress

Expand Down
Loading