File: ci.yml

package info (click to toggle)
proftpd-mod-vroot 0.9.12-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 940 kB
  • sloc: perl: 12,189; sh: 3,287; ansic: 2,219; makefile: 116
file content (208 lines) | stat: -rw-r--r-- 6,604 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  schedule:
    - cron: '11 1 * * 0'

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        compiler:
          - clang
          - gcc
        container:
          - almalinux:8
          - alpine:3.14
          - ubuntu:18.04

    container: ${{ matrix.container }}

    steps:
      - name: Checkout ProFTPD
        uses: actions/checkout@v2
        with:
          repository: proftpd/proftpd
          path: proftpd

      - name: Checkout module source code
        uses: actions/checkout@v2
        with:
          path: proftpd/contrib/mod_vroot

      - name: Whitespace check
        if: ${{ matrix.container == 'ubuntu:18.04' }}
        run: |
          apt-get update -qq
          apt-get install -y git
          cd proftpd/contrib/mod_vroot
          if [[ -n $(git diff --check HEAD^) ]]; then
            echo "You must remove whitespace before submitting a pull request"
            echo ""
            git diff --check HEAD^
            exit 1
          fi

      - name: Install Alpine packages
        if: ${{ matrix.container == 'alpine:3.14' }}
        run: |
          apk update
          # for builds
          apk add bash build-base clang compiler-rt-static gcc make zlib-dev
          # for unit tests
          apk add check check-dev subunit subunit-dev

          # for OpenSSL support
          apk add openssl openssl-dev

          # for debugging
          clang --version
          gcc --version
          openssl version -a

      - name: Install RPM packages
        if: ${{ matrix.container == 'almalinux:8' }}
        run: |
          # Need to add other repos for e.g. libsodium
          yum install -y dnf-plugins-core epel-release yum-utils clang gcc make zlib-devel
          dnf config-manager --enable epel
          dnf config-manager --set-enabled powertools
          # for unit tests
          yum install -y check-devel https://cbs.centos.org/kojifiles/packages/subunit/1.4.0/1.el8/x86_64/subunit-1.4.0-1.el8.x86_64.rpm https://cbs.centos.org/kojifiles/packages/subunit/1.4.0/1.el8/x86_64/subunit-devel-1.4.0-1.el8.x86_64.rpm

          # for OpenSSL support
          yum install -y openssl openssl-devel

          # for debugging
          clang --version
          gcc --version
          openssl version -a

      - name: Install Ubuntu packages
        if: ${{ matrix.container == 'ubuntu:18.04' }}
        run: |
          apt-get update -qq
          # for builds
          apt-get install -y clang gcc make
          # for unit tests
          apt-get install -y check libsubunit-dev

          # for OpenSSL support
          apt-get install -y libssl-dev

          # for integration/regression test
          apt-get install -y \
            libcompress-raw-zlib-perl \
            libdata-dumper-simple-perl \
            libdatetime-perl \
            libfile-copy-recursive-perl \
            libfile-path-tiny-perl \
            libfile-spec-native-perl \
            libnet-inet6glue-perl \
            libnet-ssh2-perl \
            libnet-ssleay-perl \
            libnet-telnet-perl \
            libposix-2008-perl \
            libtest-unit-perl \
            libtime-hr-perl \
            libwww-perl
          PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'install Net::FTPSSL'

          # for test code coverage
          apt-get install -y lcov ruby
          gem install coveralls-lcov
          # for HTML validation
          apt-get install -y tidy

          # for debugging
          clang --version
          gcc --version
          openssl version -a

      - name: Prepare code coverage
        if: ${{ matrix.container == 'ubuntu:18.04' }}
        run: |
          lcov --directory proftpd --zerocounters

      - name: Build as static module
        env:
          CC: ${{ matrix.compiler }}
        run: |
          cd proftpd
          ./configure LIBS="-lm -lsubunit -lrt -pthread" --enable-devel=coverage --enable-tests --with-modules=mod_vroot:mod_sftp:mod_ifsession
          make

      - name: Run unit tests
        env:
          CC: ${{ matrix.compiler }}
        # Note: Skip the unit tests on Alpine
        if: ${{ matrix.container != 'alpine:3.14' }}
        run: |
          cd proftpd/contrib/mod_vroot
          make TEST_VERBOSE=1 check

      - name: Install as static module
        run: |
          cd proftpd
          make install

      - name: Run integration tests
        if: ${{ matrix.compiler == 'gcc' && matrix.container == 'ubuntu:18.04' }}
        env:
          PROFTPD_TEST_BIN: /usr/local/sbin/proftpd
          PROFTPD_TEST_DIR: ${{ github.workspace }}/proftpd
        run: |
          cd proftpd/contrib/mod_vroot
          perl tests.pl

      - name: Build as shared module
        env:
          CC: ${{ matrix.compiler }}
        run: |
          cd proftpd
          make clean
          ./configure LIBS="-lm -lsubunit -lrt -pthread" --enable-devel --enable-dso --with-shared=mod_vroot
          make

      - name: Install as shared module
        run: |
          cd proftpd
          make install

      # https://github.com/google/sanitizers/wiki/AddressSanitizer
      # https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer
      # https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
      #
      # NOTE: Using MemorySanitizer is desirable, but currently unusable since
      # libcheck is not instrumented, resulting in unsuppressible false
      # positives.
      - name: Run unit tests under asan+lsan+ubsan
        env:
          ASAN_OPTIONS: abort_on_error=1,check_initialization_order=true,debug=true,detect_invalid_pointer_pairs=2,detect_leaks=1,detect_stack_use_after_return=true,strict_string_checks=true,verbosity=0
          CC: ${{ matrix.compiler }}
          CFLAGS: -fsanitize=address,undefined
          LDFLAGS: -fsanitize=address,undefined --coverage
        if: ${{ matrix.compiler == 'gcc' && matrix.container == 'ubuntu:18.04' }}
        run: |
          cd proftpd
          make clean
          ./configure LIBS="-lm -lsubunit -lrt -pthread" --enable-devel --enable-tests --with-modules=mod_vroot
          make
          cd contrib/mod_vroot
          export ASAN_SYMBOLIZER_PATH=$(readlink -f $(which llvm-symbolizer-10))
          make TEST_VERBOSE=1 check

      - name: Check HTML docs
        if: ${{ matrix.container == 'ubuntu:18.04' }}
        run: |
          cd proftpd/contrib/mod_vroot
          echo "Processing mod_vroot.html"
          tidy -errors -omit -q mod_vroot.html | exit 0