mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-03 18:49:29 -05:00
84 lines
2.8 KiB
YAML
84 lines
2.8 KiB
YAML
---
|
|
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
# Run test for any PRs
|
|
pull_request:
|
|
|
|
jobs:
|
|
codespell:
|
|
name: codespell
|
|
strategy:
|
|
fail-fast: false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Codespell
|
|
uses: codespell-project/actions-codespell@v2
|
|
with:
|
|
skip: "./.git,./.gitignore,./ABOUT-NLS,*.po,./gl,./po,./tools/squid.conf,./build-aux/ltmain.sh"
|
|
ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners,esponse
|
|
check_filenames: true
|
|
check_hidden: true
|
|
# super-linter:
|
|
# name: super-linter
|
|
# strategy:
|
|
# fail-fast: false
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Checkout
|
|
# uses: actions/checkout@v4
|
|
# - name: Lint Code Base
|
|
# uses: github/super-linter@v5.0.0
|
|
# env:
|
|
# DEFAULT_BRANCH: master
|
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# macos:
|
|
# ...
|
|
linux:
|
|
needs:
|
|
- codespell
|
|
# - super-linter
|
|
runs-on: ubuntu-latest
|
|
name: Running tests on ${{ matrix.distro }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
distro:
|
|
- 'debian:stable'
|
|
#...
|
|
include:
|
|
- distro: 'debian:stable'
|
|
prepare: .github/prepare_debian.sh
|
|
#...
|
|
steps:
|
|
- name: Git clone repository
|
|
uses: actions/checkout@v4
|
|
#- name: Setup tmate session, see https://github.com/marketplace/actions/debugging-with-tmate
|
|
# uses: mxschmitt/action-tmate@v3
|
|
- name: Run the tests on ${{ matrix.distro }}
|
|
run: |
|
|
docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol
|
|
docker run \
|
|
-e NPTEST_ACCEPTDEFAULT=1 \
|
|
-e NPTEST_CACHE="/src/.github/NPTest.cache" \
|
|
-w /src -v ${PWD}:/src \
|
|
--tmpfs /media/ramdisk1 \
|
|
-v /var/run/utmp:/var/run/utmp \
|
|
--mount source=tmp-vol,destination=/src,target=/media/ramdisk2 \
|
|
${{ matrix.distro }} \
|
|
/bin/sh -c '${{ matrix.prepare }} && \
|
|
tools/setup && \
|
|
./configure --enable-libtap --with-ipv6=no && \
|
|
set -x && \
|
|
tmp_dir=$(mktemp -d -t test-XXXX) && cp -a po/ $tmp_dir/ && \
|
|
cd po && make update-po && cd .. && \
|
|
diff -Nur $tmp_dir/po/*.po po/*.po | tee -a /tmp/po.diff && diff -Nur $tmp_dir/po/*.pot po/*.pot | tee -a /tmp/po.diff && if [ $(wc -l /tmp/po.diff | cut -f 1 -d" ") -gt 0 ]; then echo "Error: Translations needs to be updated with make update-po!" && exit 1; fi && \
|
|
make && \
|
|
make test'
|
|
docker container prune -f
|
|
docker volume prune -f
|