-
Notifications
You must be signed in to change notification settings - Fork 38
52 lines (52 loc) · 1.77 KB
/
ci.yml
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
# Copyright 2022 Timo Röhling <timo@gaussglocke.de>
# 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
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
milter: [OFF, ON]
sqlite: [OFF, ON]
redis: [OFF, ON]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y cmake postfix redis
- name: Build PostSRSd
run: |
mkdir _build
cd _build
cmake .. -DDEVELOPER_BUILD=ON -DWITH_MILTER=${{ matrix.milter }} -DWITH_SQLITE=${{ matrix.sqlite }} -DWITH_REDIS=${{ matrix.redis }}
make VERBOSE=ON
- 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