diff options
author | waja <waja@users.noreply.github.com> | 2024-02-23 13:25:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 13:25:44 (GMT) |
commit | 0c01f2946ed21f5e7977b5503f9c9f00e72fd708 (patch) | |
tree | 12970968285d666e22d7d06644804edd2bf7d7e7 /.github/workflows/test.yml | |
parent | f6d7bf86563e53aeca1f764a4c61e6025049406a (diff) | |
download | monitoring-plugins-0c01f2946ed21f5e7977b5503f9c9f00e72fd708.tar.gz |
CI specfile (#1894)
* 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>
Diffstat (limited to '.github/workflows/test.yml')
-rw-r--r-- | .github/workflows/test.yml | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4975f1..33220d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml | |||
@@ -1,65 +1,27 @@ | |||
1 | --- | 1 | --- |
2 | name: Test | 2 | name: Tests |
3 | 3 | ||
4 | on: | 4 | on: |
5 | push: | 5 | push: |
6 | branches: | 6 | branches: |
7 | - '*' | 7 | - '*' |
8 | # Run test for any PRs | ||
9 | pull_request: | 8 | pull_request: |
10 | 9 | ||
11 | jobs: | 10 | jobs: |
12 | codespell: | 11 | full-test: |
13 | name: codespell | 12 | name: Running unit and integrationt tests |
14 | strategy: | ||
15 | fail-fast: false | ||
16 | runs-on: ubuntu-latest | 13 | runs-on: ubuntu-latest |
17 | steps: | ||
18 | - name: Checkout | ||
19 | uses: actions/checkout@v4 | ||
20 | - name: Codespell | ||
21 | uses: codespell-project/actions-codespell@v2 | ||
22 | with: | ||
23 | skip: "./.git,./.gitignore,./ABOUT-NLS,./gl,./tools/squid.conf,./build-aux/ltmain.sh,THANKS.in" | ||
24 | ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners,esponse,slac | ||
25 | check_filenames: true | ||
26 | check_hidden: true | ||
27 | # super-linter: | ||
28 | # name: super-linter | ||
29 | # strategy: | ||
30 | # fail-fast: false | ||
31 | # runs-on: ubuntu-latest | ||
32 | # steps: | ||
33 | # - name: Checkout | ||
34 | # uses: actions/checkout@v4 | ||
35 | # - name: Lint Code Base | ||
36 | # uses: github/super-linter@v5.0.0 | ||
37 | # env: | ||
38 | # DEFAULT_BRANCH: master | ||
39 | # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
40 | # macos: | ||
41 | # ... | ||
42 | linux: | ||
43 | needs: | ||
44 | - codespell | ||
45 | # - super-linter | ||
46 | runs-on: ubuntu-latest | ||
47 | name: Running tests on ${{ matrix.distro }} | ||
48 | strategy: | 14 | strategy: |
49 | fail-fast: false | 15 | fail-fast: false |
50 | matrix: | 16 | matrix: |
51 | distro: | 17 | distro: |
52 | - 'debian:stable' | 18 | - 'debian:stable' |
53 | #... | ||
54 | include: | 19 | include: |
55 | - distro: 'debian:stable' | 20 | - distro: 'debian:stable' |
56 | prepare: .github/prepare_debian.sh | 21 | prepare: .github/prepare_debian.sh |
57 | #... | ||
58 | steps: | 22 | steps: |
59 | - name: Git clone repository | 23 | - name: Git clone repository |
60 | uses: actions/checkout@v4 | 24 | uses: actions/checkout@v4 |
61 | #- name: Setup tmate session, see https://github.com/marketplace/actions/debugging-with-tmate | ||
62 | # uses: mxschmitt/action-tmate@v3 | ||
63 | - name: Run the tests on ${{ matrix.distro }} | 25 | - name: Run the tests on ${{ matrix.distro }} |
64 | run: | | 26 | run: | |
65 | docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol | 27 | docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol |
@@ -83,3 +45,35 @@ jobs: | |||
83 | make' | 45 | make' |
84 | docker container prune -f | 46 | docker container prune -f |
85 | docker volume prune -f | 47 | docker volume prune -f |
48 | |||
49 | build-test: | ||
50 | name: Running rpm build test on ${{ matrix.distro }} | ||
51 | runs-on: ubuntu-latest | ||
52 | strategy: | ||
53 | fail-fast: false | ||
54 | matrix: | ||
55 | include: | ||
56 | - {"distro": "fedora:latest", "build": ".github/mock.sh"} | ||
57 | - {"distro": "fedora:rawhide", "build": ".github/mock.sh"} | ||
58 | - {"distro": "rockylinux:8", "build": ".github/mock.sh"} | ||
59 | - {"distro": "almalinux:9", "build": ".github/mock.sh"} | ||
60 | # - {"distro": "oraclelinux:9", "build": ".github/mock.sh"} | ||
61 | steps: | ||
62 | - name: Git clone repository | ||
63 | uses: actions/checkout@v4 | ||
64 | - name: Run the tests on ${{ matrix.distro }} | ||
65 | run: | | ||
66 | docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol | ||
67 | docker run \ | ||
68 | --privileged=true \ | ||
69 | -e NPTEST_ACCEPTDEFAULT=1 \ | ||
70 | -e NPTEST_CACHE="/src/.github/NPTest.cache" \ | ||
71 | -w /src -v ${PWD}:/src \ | ||
72 | --tmpfs /media/ramdisk1 \ | ||
73 | -v /var/run/utmp:/var/run/utmp \ | ||
74 | --mount source=tmp-vol,destination=/src,target=/media/ramdisk2 \ | ||
75 | ${{ matrix.distro }} \ | ||
76 | /bin/sh -c '${{ matrix.build }} && \ | ||
77 | ls -la' | ||
78 | docker container prune -f | ||
79 | docker volume prune -f | ||