# Copyright 2022 Timo Röhling # SPDX-License-Identifier: FSFAP # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice and # this notice are preserved. This file is offered as-is, without any warranty. # name: Continuous Integration on: push: branches: - main pull_request: branches: - main permissions: contents: read jobs: test: runs-on: ubuntu-latest strategy: matrix: milter: [MILTER=OFF, MILTER=ON] sqlite: [SQLITE=OFF, SQLITE=ON] redis: [REDIS=OFF, REDIS=ON] deps: [vendored-deps, system-deps] steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update -qq sudo apt-get install -y cmake postfix redis ${{ matrix.deps == 'system-deps' && 'check libconfuse-dev libhiredis-dev libmilter-dev libsqlite3-dev' || '' }} - name: Build PostSRSd run: | mkdir _build cd _build cmake .. -DDEVELOPER_BUILD=ON -DWITH_${{ matrix.milter }} -DWITH_${{ matrix.sqlite }} -DWITH_${{ matrix.redis }} ${{ matrix.deps == 'system-deps' && '-DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS' || '' }} cmake --build . --verbose - name: Run tests run: | cd _build ctest --output-on-failure - name: Install and start PostSRSd daemon run: | cd _build sudo make install sed -e 's/^#srs-domain.*/srs-domain = "example.com"/' /usr/local/share/doc/postsrsd/postsrsd.conf | sudo tee /usr/local/etc/postsrsd.conf sudo systemctl enable postsrsd sudo systemctl start postsrsd sudo journalctl --no-pager -u postsrsd sudo systemctl --no-pager status postsrsd - name: Test Postfix integration run: | postmap -q test@otherdomain.com socketmap:unix:/var/spool/postfix/srs:forward | tee /tmp/srs-alias.txt postmap -q "$(cat /tmp/srs-alias.txt)" socketmap:unix:/var/spool/postfix/srs:reverse