From 0c01f2946ed21f5e7977b5503f9c9f00e72fd708 Mon Sep 17 00:00:00 2001 From: waja Date: Fri, 23 Feb 2024 14:25:44 +0100 Subject: CI specfile (#1894) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding spec file and github pipeline for testing * Restructure github pipelines for more clarity * Add build tests for several RPM based distributions --------- Co-authored-by: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> --- .github/workflows/spellcheck.yml | 27 ++++++++++++++ .github/workflows/test.yml | 76 ++++++++++++++++++---------------------- 2 files changed, 62 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/spellcheck.yml (limited to '.github/workflows') diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 00000000..72f7c7eb --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,27 @@ +--- +name: Spellcheck + +on: + # Run for pushes on any branch + push: + branches: + - '*' + # Run 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,./gl,./tools/squid.conf,./build-aux/ltmain.sh,THANKS.in" + ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners,esponse,slac + check_filenames: true + check_hidden: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4975f1d..33220d6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,65 +1,27 @@ --- -name: Test +name: Tests on: push: branches: - '*' - # Run test for any PRs pull_request: jobs: - codespell: - name: codespell - strategy: - fail-fast: false + full-test: + name: Running unit and integrationt tests 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,./gl,./tools/squid.conf,./build-aux/ltmain.sh,THANKS.in" - ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners,esponse,slac - 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 @@ -83,3 +45,35 @@ jobs: make' docker container prune -f docker volume prune -f + + build-test: + name: Running rpm build test on ${{ matrix.distro }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - {"distro": "fedora:latest", "build": ".github/mock.sh"} + - {"distro": "fedora:rawhide", "build": ".github/mock.sh"} + - {"distro": "rockylinux:8", "build": ".github/mock.sh"} + - {"distro": "almalinux:9", "build": ".github/mock.sh"} +# - {"distro": "oraclelinux:9", "build": ".github/mock.sh"} + steps: + - name: Git clone repository + uses: actions/checkout@v4 + - 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 \ + --privileged=true \ + -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.build }} && \ + ls -la' + docker container prune -f + docker volume prune -f -- cgit v1.2.3-74-g34f1 From d7579e42495e2ad83a48d1cea258c6b708aea603 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Wed, 2 Oct 2024 11:42:22 +0200 Subject: add new github test workflow for debian:testing and fedora:rawhide this workflow runs scheduled once a week, so it does not prevent PRs from being merged but still allows us to notice if anything will go wrong with the next release. Remove rawhide test from the mandatory tests like we did with debian testing already. --- .github/workflows/test-next.yml | 77 +++++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 1 - 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-next.yml (limited to '.github/workflows') diff --git a/.github/workflows/test-next.yml b/.github/workflows/test-next.yml new file mode 100644 index 00000000..083bc1e4 --- /dev/null +++ b/.github/workflows/test-next.yml @@ -0,0 +1,77 @@ +--- +name: Tests Debian:Testing and Fedora:Rawhide + +on: + push: + branches-ignore: + - '*' + schedule: + # Run every week on Monday at 9:00 AM (UTC) + - cron: '0 9 * * 1' + +jobs: + full-test: + name: Running unit and integrationt tests + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + distro: + - 'debian:testing' + include: + - distro: 'debian:testing' + prepare: .github/prepare_debian.sh + steps: + - name: Git clone repository + uses: actions/checkout@v4 + - 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 && \ + make && \ + make test && \ + make dist && \ + tar zxf monitoring-plugins-*.tar.gz && \ + cd monitoring-plugins-*/ && \ + ./configure && \ + make' + docker container prune -f + docker volume prune -f + + build-test: + name: Running rpm build test on ${{ matrix.distro }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - {"distro": "fedora:rawhide", "build": ".github/mock.sh"} + steps: + - name: Git clone repository + uses: actions/checkout@v4 + - 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 \ + --privileged=true \ + -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.build }} && \ + ls -la' + docker container prune -f + docker volume prune -f diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33220d6d..77ca6585 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,6 @@ jobs: matrix: include: - {"distro": "fedora:latest", "build": ".github/mock.sh"} - - {"distro": "fedora:rawhide", "build": ".github/mock.sh"} - {"distro": "rockylinux:8", "build": ".github/mock.sh"} - {"distro": "almalinux:9", "build": ".github/mock.sh"} # - {"distro": "oraclelinux:9", "build": ".github/mock.sh"} -- cgit v1.2.3-74-g34f1 From 2558e488f35334d75f662cb94dc2122f68c7740a Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Wed, 2 Oct 2024 20:59:31 +0200 Subject: add manual workflow trigger --- .github/workflows/test-next.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.github/workflows') diff --git a/.github/workflows/test-next.yml b/.github/workflows/test-next.yml index 083bc1e4..81240759 100644 --- a/.github/workflows/test-next.yml +++ b/.github/workflows/test-next.yml @@ -2,6 +2,7 @@ name: Tests Debian:Testing and Fedora:Rawhide on: + workflow_dispatch: {} push: branches-ignore: - '*' -- cgit v1.2.3-74-g34f1