diff options
Diffstat (limited to '.github/workflows/test.yml')
| -rw-r--r-- | .github/workflows/test.yml | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..0f845de7 --- /dev/null +++ b/.github/workflows/test.yml | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | --- | ||
| 2 | name: Test | ||
| 3 | |||
| 4 | on: | ||
| 5 | push: | ||
| 6 | branches: | ||
| 7 | - '*' | ||
| 8 | # Run test for any PRs | ||
| 9 | pull_request: | ||
| 10 | |||
| 11 | jobs: | ||
| 12 | codespell: | ||
| 13 | name: codespell | ||
| 14 | strategy: | ||
| 15 | fail-fast: false | ||
| 16 | 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,*.po,./gl,./po,./tools/squid.conf,./build-aux/ltmain.sh" | ||
| 24 | ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners,esponse | ||
| 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: | ||
| 49 | fail-fast: false | ||
| 50 | matrix: | ||
| 51 | distro: | ||
| 52 | - 'debian:stable' | ||
| 53 | #... | ||
| 54 | include: | ||
| 55 | - distro: 'debian:stable' | ||
| 56 | prepare: .github/prepare_debian.sh | ||
| 57 | #... | ||
| 58 | steps: | ||
| 59 | - name: Git clone repository | ||
| 60 | 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 }} | ||
| 64 | run: | | ||
| 65 | docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol | ||
| 66 | docker run \ | ||
| 67 | -e NPTEST_ACCEPTDEFAULT=1 \ | ||
| 68 | -e NPTEST_CACHE="/src/.github/NPTest.cache" \ | ||
| 69 | -w /src -v ${PWD}:/src \ | ||
| 70 | --tmpfs /media/ramdisk1 \ | ||
| 71 | -v /var/run/utmp:/var/run/utmp \ | ||
| 72 | --mount source=tmp-vol,destination=/src,target=/media/ramdisk2 \ | ||
| 73 | ${{ matrix.distro }} \ | ||
| 74 | /bin/sh -c '${{ matrix.prepare }} && \ | ||
| 75 | tools/setup && \ | ||
| 76 | ./configure --enable-libtap --with-ipv6=no && \ | ||
| 77 | set -x && \ | ||
| 78 | tmp_dir=$(mktemp -d -t test-XXXX) && cp -a po/ $tmp_dir/ && \ | ||
| 79 | cd po && make update-po && cd .. && \ | ||
| 80 | 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 && \ | ||
| 81 | make && \ | ||
| 82 | make test' | ||
| 83 | docker container prune -f | ||
| 84 | docker volume prune -f | ||
