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