Disable -Wchar-subscripts instead of ugly casts #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2022-2026 Timo Röhling <[email protected]> | |
| # 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: CI (Linux) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| ubuntu: | |
| name: Ubuntu | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| 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 gperf ${{ case(matrix.deps == 'system-deps', 'check libseccomp-dev libconfuse-dev libhiredis-dev libsqlite3-dev', '') }} | |
| - name: Build PostSRSd | |
| run: | | |
| mkdir _build | |
| cd _build | |
| cmake .. -DDEVELOPER_BUILD=ON -DTESTS_WITH_ASAN=ON -DTESTS_WITH_REDIS=ON -DWITH_SECCOMP=ON -DWITH_${{ matrix.sqlite }} -DWITH_${{ matrix.redis }} ${{ case(matrix.deps == 'system-deps', '-DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS', '') }} | |
| cmake --build . --verbose | |
| - name: Run tests | |
| run: | | |
| cd _build | |
| ctest --verbose | |
| - name: Install and start PostSRSd daemon | |
| run: | | |
| cd _build | |
| sudo make install | |
| sed -e 's/^#srs-domain.*/srs-domain = "example.com"/' -e 's!^#milter.*!milter = unix:/var/spool/postfix/srs_milter!' /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 | |
| sudo systemd-analyze --no-pager security postsrsd | |
| - name: Test Postfix integration | |
| run: | | |
| echo -e "@example.com $(whoami)\[email protected] $(whoami)" | sudo tee /etc/postfix/virtual | |
| sudo postmap hash:/etc/postfix/virtual | |
| sudo postconf -e non_smtpd_milters=unix:srs_milter smtpd_milters=unix:srs_milter "virtual_alias_domains=example.com otherdomain.com" virtual_alias_maps=hash:/etc/postfix/virtual | |
| sudo postfix reload | |
| postmap -q [email protected] 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 | |
| echo -e 'Subject: Forward SRS\r\n\r\nThis is the first test\r\n\r\n\r\n' | sendmail -f [email protected] -- [email protected] | |
| echo -e 'Subject: Reverse SRS\r\n\r\nThis is the second test\r\n\r\n\r\n' | sendmail -f [email protected] -- $(cat /tmp/srs-alias.txt) | |
| sleep 2 | |
| sudo tail /var/log/mail.log || true | |
| sudo cat $(postconf -h mail_spool_directory)/* || true | |
| - name: Test notify-reload | |
| run: | | |
| sudo systemctl reload postsrsd | |
| sleep 1 | |
| sudo systemctl --no-pager status postsrsd |