Skip to content
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
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI Build

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Only load SSH key if the secret exists (avoids hard crash on unprivileged PRs)
- name: Install SSH Key
if: env.SSH_KEY != ''
uses: webfactory/ssh-agent@v0.9.0
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Install dependencies & Build
run: |
pip install -r requirements.txt
pip install pycodestyle
docker build --rm -f "Dockerfile" -t icinga2-cli "."
echo "const PluginDir = \"/usr/lib/nagios/plugins\"" > constants.conf
echo "const ManubulonPluginDir = \"/usr/lib/nagios/plugins\"" >> constants.conf
echo "const PluginContribDir = \"/usr/lib/nagios/plugins\"" >> constants.conf
echo "const NodeName = \"clarin-monitoring\"" >> constants.conf
echo "const ZoneName = \"clarin-monitoring\"" >> constants.conf
mkdir -p features-enabled

- name: Run Tests
run: |
find . -name "*.py" -exec pycodestyle {} +
python3 update_config.py --nopull --nosubmodule
docker run --rm -v $(pwd):/etc/icinga2/ icinga2-cli

#
#Disabled email notifications, for now rely on github CI notifications
#
# # Step 7: Send Email Notifications (Runs always, regardless of success/failure)
# - name: Send Email Notification
# if: always()
# uses: dawidd6/action-send-mail@v3
# with:
# # You will need to set up an SMTP server secret for this to work
# server_address: ${{ secrets.SMTP_SERVER }}
# server_port: 465
# username: ${{ secrets.SMTP_USERNAME }}
# password: ${{ secrets.SMTP_PASSWORD }}
# subject: GitHub Actions Run ${{ job.status }} - ${{ github.repository }}
# to: bernd.schloer@gwdg.de, sysops@clarin.eu
# from: GitHub Actions <ci@clarin.eu>
# body: |
# The build status is: ${{ job.status }}
# Repository: ${{ github.repository }}
# Commit: ${{ github.sha }}
# View logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

Binary file removed id_travis.enc
Binary file not shown.
Loading